diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/YesOrNoEnum.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/YesOrNoEnum.java index 0d4c355..f54d289 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/YesOrNoEnum.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/YesOrNoEnum.java @@ -36,4 +36,19 @@ public enum YesOrNoEnum { public void setValue(String value) { this.value = value; } + + /** + * 根据value获取key + * + * @return + */ + public static String getKeyName(String value) { + final YesOrNoEnum[] values = YesOrNoEnum.values(); + for (YesOrNoEnum order : values) { + if (value.equals(order.getValue())) { + return order.getKey(); + } + } + return null; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java index ac0b79c..0df408e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java @@ -3,6 +3,7 @@ package com.fuint.common.service.impl; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.common.Constants; @@ -60,7 +61,7 @@ public class OrderServiceImpl extends ServiceImpl implem private MtOrderMapper mtOrderMapper; private MtGoodsMapper mtGoodsMapper; - + private MtUserMapper mtUserMapper; private MtOrderGoodsMapper mtOrderGoodsMapper; private MtCartMapper mtCartMapper; @@ -2237,8 +2238,20 @@ public class OrderServiceImpl extends ServiceImpl implem } } String userName = rowContent.get(6); + if (ObjectUtil.isNotEmpty(userName)){ + MtUser m= mtUserMapper.selectOne(new QueryWrapper().lambda().eq(MtUser::getMobile,userName)); + if(ObjectUtil.isNotEmpty(m)){ + order.setUserId(m.getId()); + } + } String isVisitor = rowContent.get(7); - order.setIsVisitor(isVisitor); + if(StringUtil.isNotEmpty(isVisitor)){ + String keyName = YesOrNoEnum.getKeyName(isVisitor); + if(StringUtil.isNotEmpty(keyName)){ + order.setIsVisitor(keyName); + } + } + String amount = rowContent.get(8); if(StringUtil.isNotEmpty(amount)){ order.setAmount(new BigDecimal(amount)); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendOrderController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendOrderController.java index d591330..1ccbdc0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendOrderController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendOrderController.java @@ -615,7 +615,7 @@ public class BackendOrderController extends BaseController { * @throws */ @ApiOperation(value = "上传文件") - @RequestMapping(value = "/importData", method = RequestMethod.POST, produces = "text/html;charset=UTF-8") + @RequestMapping(value = "/importData", method = RequestMethod.POST) @CrossOrigin public ResponseObject uploadFile(HttpServletRequest request, @RequestParam("file") MultipartFile file) throws Exception { String token = request.getHeader("Access-Token"); diff --git a/fuintBackend/fuint-application/src/main/resources/application-dev.properties b/fuintBackend/fuint-application/src/main/resources/application-dev.properties index ae6a85e..457d47f 100644 --- a/fuintBackend/fuint-application/src/main/resources/application-dev.properties +++ b/fuintBackend/fuint-application/src/main/resources/application-dev.properties @@ -32,13 +32,13 @@ system.name = \u674E\u5B66\u6B66\u7261\u4E39\u74F7\u5B98\u65B9\u65D7\u8230\u5E97 website.url=https://www.huamar.com/h5/ # \u4E0A\u4F20\u56FE\u7247\u672C\u5730\u5730\u5740 -#images.root=D:/daima/yshi/fuintBackend/fuint-application/target/classes -images.root=D:/download -images.path=/profile/ -#images.path=/static/uploadImages/ +images.root=/target/classes +#images.root=D:/download +#images.path=/profile/ +images.path=/static/uploadImages/ # \u4E0A\u4F20\u56FE\u7247\u670D\u52A1\u5668\u57DF\u540D -images.upload.url=http://192.168.10.110:8999 +images.upload.url=http://192.168.10.70:8999 # \u4E0A\u4F20\u56FE\u7247\u5141\u8BB8\u7684\u5927\u5C0F\uFF08\u5355\u4F4D\uFF1AMB\uFF09 images.upload.maxSize=5 diff --git a/fuintBackend/fuint-application/src/main/resources/application-prod.properties b/fuintBackend/fuint-application/src/main/resources/application-prod.properties index 3aff22f..071a7bc 100644 --- a/fuintBackend/fuint-application/src/main/resources/application-prod.properties +++ b/fuintBackend/fuint-application/src/main/resources/application-prod.properties @@ -36,7 +36,7 @@ website.url=https://www.fuint.cn/h5/ images.path=/static/uploadImages/ # \u4E0A\u4F20\u56FE\u7247\u670D\u52A1\u5668\u57DF\u540D -images.upload.url=http://192.168.10.31:8999l +images.upload.url=http://192.168.10.31:8999 # \u4E0A\u4F20\u56FE\u7247\u5141\u8BB8\u7684\u5927\u5C0F\uFF08\u5355\u4F4D\uFF1AMB\uFF09 images.upload.maxSize=5 diff --git a/fuintBackend/fuint-application/src/main/resources/template/订单导入模板.xlsx b/fuintBackend/fuint-application/src/main/resources/template/订单导入模板.xlsx index 8b93e03..f7541e1 100644 Binary files a/fuintBackend/fuint-application/src/main/resources/template/订单导入模板.xlsx and b/fuintBackend/fuint-application/src/main/resources/template/订单导入模板.xlsx differ diff --git a/fuintBackend/fuint-framework/src/main/java/com/fuint/framework/web/ResponseObject.java b/fuintBackend/fuint-framework/src/main/java/com/fuint/framework/web/ResponseObject.java index 8bcb287..bdb499b 100644 --- a/fuintBackend/fuint-framework/src/main/java/com/fuint/framework/web/ResponseObject.java +++ b/fuintBackend/fuint-framework/src/main/java/com/fuint/framework/web/ResponseObject.java @@ -1,5 +1,7 @@ package com.fuint.framework.web; +import java.io.Serializable; + /** * 返回数据结构 * @@ -7,8 +9,8 @@ package com.fuint.framework.web; * * CopyRight https://www.fuint.cn */ -public class ResponseObject { - +public class ResponseObject implements Serializable { + private static final long serialVersionUID = 2515641477316172528L; private int code; private String message; private Object data; diff --git a/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtOrder.java b/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtOrder.java index 102b6c7..9afef18 100644 --- a/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtOrder.java +++ b/fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtOrder.java @@ -36,7 +36,7 @@ public class MtOrder implements Serializable { private String payType; @ApiModelProperty("订单模式") - private String orderMode; + private String orderMode ; @ApiModelProperty("订单号") private String orderSn; @@ -57,7 +57,7 @@ public class MtOrder implements Serializable { private String verifyCode; @ApiModelProperty("是否游客") - private String isVisitor; + private String isVisitor="N"; @ApiModelProperty("订单金额") private BigDecimal amount; @@ -90,19 +90,19 @@ public class MtOrder implements Serializable { private String remark; @ApiModelProperty("创建时间") - private Date createTime; + private Date createTime = new Date(); @ApiModelProperty("更新时间") - private Date updateTime; + private Date updateTime = new Date(); @ApiModelProperty("订单状态") - private String status; + private String status ="B"; @ApiModelProperty("支付时间") - private Date payTime; + private Date payTime = new Date(); @ApiModelProperty("支付状态") - private String payStatus; + private String payStatus="B"; @ApiModelProperty("操作员工") private Integer staffId;