().eq(ZyPlanProcess::getPlanId, k.getId()));
+ Optional.ofNullable(planProcessList).orElse(new LinkedList<>()).forEach(e -> {
+ // 5,生成物料单
+ zyPlanProcessService.createMaterialBill(e);
+ // 5,发送到仓库
+ zyPlanProcessService.sendToRepository(e);
+ });
// }
});
}
/**
+ * 匹配设备&工具&工人
+ *
* 匹配车间工位设备与工序设备,工位设备包含工序设备即匹配成功,匹配失败做异常处理
* 匹配车间工位工具与工序设备,工位设备包含工序设备即匹配成功,匹配失败做异常处理
*
@@ -265,8 +341,9 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl planProcessList2 = zyPlanProcessService.list(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, planId));
//匹配工人
- this.diffWorker(planProcessList, planId);
+ this.diffWorker(planProcessList2, planId);
return true;
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ApeopersionController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ApeopersionController.java
index cce126b6..a548bbe2 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ApeopersionController.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ApeopersionController.java
@@ -3,24 +3,37 @@ package org.jeecg.modules.system.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
+import com.google.common.base.Joiner;
+import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.aspectj.apache.bcel.generic.RET;
import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.base.service.BaseCommonService;
+import org.jeecg.modules.demo.customercollectgoods.entity.Customercollectgoods;
+import org.jeecg.modules.demo.customercollectgoods.service.ICustomercollectgoodsService;
+import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress;
+import org.jeecg.modules.demo.customerreceivingaddress.service.ICustomerReceivingAddressService;
+import org.jeecg.modules.demo.customershoppingcart.entity.CustomerShoppingCart;
+import org.jeecg.modules.demo.customershoppingcart.service.ICustomerShoppingCartService;
+import org.jeecg.modules.demo.zygoods.entity.ZyGoods;
+import org.jeecg.modules.demo.zygoods.service.IZyGoodsService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
+import org.jeecg.modules.system.vo.Grzx1;
+import org.jeecg.modules.system.vo.Grzx2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.lang.reflect.Field;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
/*
这个是个人中心专用控制器,之前全都写在SysUserController(用户控制器里面,感觉不妥)因此就专门拖出来一个
@@ -34,6 +47,18 @@ public class ApeopersionController {
@Autowired
private ISysUserService sysUserService;
+ @Autowired
+ private ICustomercollectgoodsService customercollectgoodsService;
+
+ @Autowired
+ private IZyGoodsService zyGoodsService;
+
+ @Autowired
+ private ICustomerShoppingCartService customerShoppingCartService;
+
+ @Autowired
+ private ICustomerReceivingAddressService customerReceivingAddressService;
+
/*
个人中心,我的账户的数据获取
@@ -44,15 +69,15 @@ public class ApeopersionController {
String id = loginUser.getId();
SysUser syu = new SysUser();
syu = sysUserService.getneeduser(id);
+ findgoods();
return Result.ok(syu);
}
-
+//个人中心的我的账户页面需要的数据
@RequestMapping(value = "/updateneeduser", method = RequestMethod.GET)
public Result> updateneeduser(@RequestParam(name = "form", required = true) String form) {
Map map = JSON.parseObject(form,Map.class);
- System.out.println(map);
String id = (String) map.get("id");
String sex= map.get("sex").toString();
String birthday= (String) map.get("birthday");
@@ -60,6 +85,215 @@ public class ApeopersionController {
String phone= (String) map.get("phone");
String email= (String) map.get("email");
sysUserService.updateneed(id,sex,birthday,realname,phone,email);
+
return Result.ok("success");
}
+
+ //个人中心的我的收藏的首页需要的数据
+ @RequestMapping(value = "/findallcg", method = RequestMethod.GET)
+ public Result> findgoods() {
+ //获取当前登人的信息
+ LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+ String userid = loginUser.getUsername();
+ List g3 = new ArrayList<>();
+ //根据当前登的人获取收藏夹里面的搜藏的商品的名称及其款式
+ g3 = sysUserService.getscgoods(userid);
+ //获取的是辅料
+ List s1 =new ArrayList<>();
+ //获取的是面料
+ List s2 =new ArrayList<>();
+ //把获取的商品信息导入到新的list里面
+ for (int i=0;i findgoods(@RequestParam(name = "id", required = true) String id) {
+ //这里方便获取当前登陆信息
+ LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+ //这里获取当前登陆的id
+ String userid = loginUser.getId();
+ //这里获取当前登陆的真实姓名
+ String rlname = loginUser.getRealname();
+ //这个是根据goodid查询收藏的场频的信息
+ Customercollectgoods ccs = customercollectgoodsService.getById(id);
+ String goodid= ccs.getGoodsId();
+ //根据goodid查询goods的对象
+ ZyGoods zyd =zyGoodsService.getById(goodid);
+ //初始化购物车对象
+ CustomerShoppingCart cst =new CustomerShoppingCart();
+ //开始组装购物车对象
+ cst.setUserId(userid);
+ cst.setUsername(rlname);
+ cst.setGoodsId(zyd.getId());
+ cst.setGoodsname(zyd.getGoodsName());
+ cst.setNumber(1);
+ cst.setPrice(zyd.getPromotionPrice());
+ cst.setZj(zyd.getPromotionPrice() * 1);
+ cst.setPlaceorigin(zyd.getPlaceOrigin());
+ cst.setGoodimg(zyd.getDefaultPicture());
+ cst.setStyleId(zyd.getStyleId());
+ customerShoppingCartService.save(cst);
+ return Result.ok("添加完成");
+ }
+
+ //个人中心的我的收藏的首页需要的数据
+ @RequestMapping(value = "/delteys", method = RequestMethod.GET)
+ public Result> delteys(@RequestParam(name = "id", required = true) String id) {
+ customercollectgoodsService.removeById(id);
+ return Result.ok("添加完成");
+ }
+
+
+ //个人中心的收货地址的首页需要的数据
+ @RequestMapping(value = "/getaddress", method = RequestMethod.GET)
+ public Result> getaddress() {
+ //这里方便获取当前登陆信息
+ LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+ //这里获取当前登陆的id
+ String userid = loginUser.getId();
+ Integer usersex = loginUser.getSex();
+ //这个是根据用户id查收货地址
+ List cra =customerReceivingAddressService.getcra(userid);
+ for (int i=0;i deleteadd(@RequestParam(name="id",required=true) String id) {
+ customerReceivingAddressService.removeById(id);
+ return Result.OK("删除成功!");
+ }
+
+
+
+ @RequestMapping(value = "/getaddressbyid", method = RequestMethod.GET)
+ public Result> getaddressbyid(@RequestParam(name="id",required=true) String id) {
+ System.out.println(id);
+ /*return Result.ok("");*/
+
+ return null;
+ }
+
+ //这个功能是个人中心的地址管设置默认地址
+ @RequestMapping(value = "/sdqx", method = RequestMethod.GET)
+ public Result> sdqx(@RequestParam(name="id",required=true) String id) {
+ //根据id查询需要设置成默认收货地址的收货地址
+ CustomerReceivingAddress cus = customerReceivingAddressService.getById(id);
+ String userid = cus.getUserId();
+ Integer sort = cus.getSort();
+ //开始寻找之前的默认地址
+ CustomerReceivingAddress cusm = customerReceivingAddressService.getneed(userid);
+ //如果没有默认地址
+ if (cusm==null){
+ customerReceivingAddressService.updatesetneed(id);
+ }else{
+ //这个是更新默认地址
+ customerReceivingAddressService.updatec(cusm.getId(),sort);
+ customerReceivingAddressService.updates(id);
+ }
+ return Result.OK("成功!");
+ }
+
+ //这个功能是个人中心的地址添加收货地址,不是默认收货地址
+ @RequestMapping(value = "/addadressress", method = RequestMethod.GET)
+ public Result> addadressress(@RequestParam(name = "form", required = true) String form) {
+ System.out.println(form);
+ //这里方便获取当前登陆信息
+ LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+ //这里获取当前登陆的用户名
+ String Username = loginUser.getUsername();
+ //将前台传过来的json数据包转化成map
+ Map map = JSON.parseObject(form,Map.class);
+ //获取flag的数据
+ String flag = map.get("flag").toString();
+ //通过flag判断是否是需要的设置成默认地址
+ if (flag.equals("false")){
+ //寻找之前的排序的最后一个
+ CustomerReceivingAddress cus = customerReceivingAddressService.getcreatbuyuser(Username);
+ CustomerReceivingAddress cus2 =new CustomerReceivingAddress();
+ cus2.setUserId(loginUser.getId());
+ cus2.setCityId((String)map.get("addr"));
+ cus2.setUsernamme((String)map.get("name"));
+ cus2.setAddress((String)map.get("detailed"));
+ cus2.setMobile((String)map.get("phone"));
+ cus2.setSort(cus.getSort()+1);
+ customerReceivingAddressService.save(cus2);
+ } else if (flag.equals("true")){
+ //寻找之前的排序的最后一个
+ CustomerReceivingAddress cus = customerReceivingAddressService.getcreatbuyuser(Username);
+ //开始寻找之前的默认地址
+ CustomerReceivingAddress cusm = customerReceivingAddressService.getneedyls(Username);
+ //开始组装需要的新的默认地址
+ CustomerReceivingAddress cus2 =new CustomerReceivingAddress();
+ cus2.setUserId(loginUser.getId());
+ cus2.setCityId((String)map.get("addr"));
+ cus2.setUsernamme((String)map.get("name"));
+ cus2.setAddress((String)map.get("detailed"));
+ cus2.setMobile((String)map.get("phone"));
+ cus2.setSort(0);
+ //将新的数据写入数据库
+ customerReceivingAddressService.save(cus2);
+ //将老的默认收货地址放在排序的最后一个
+ cusm.setSort(cus.getSort()+1);
+ customerReceivingAddressService.updateById(cusm);
+ }
+
+ return Result.OK("成功!");
+ }
+
+
+
+
+ //这个功能是个人中心的地址添加收货地址,不是默认收货地址
+ @RequestMapping(value = "/updateadressress", method = RequestMethod.GET)
+ public Result> updateadressress(@RequestParam(name = "form", required = true) String form) {
+ //将前台传过来的json数据包转化成map
+ Map map = JSON.parseObject(form,Map.class);
+ //查询需要的对象
+ CustomerReceivingAddress needc = customerReceivingAddressService.getById((String)map.get("id"));
+ needc.setMobile((String)map.get("phone"));
+ needc.setUsernamme((String)map.get("name"));
+ needc.setAddress((String)map.get("detailed"));
+ needc.setCityId((String)map.get("addr"));
+ customerReceivingAddressService.updateById(needc);
+ return Result.OK("成功!");
+ }
+
+
+
+
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
index ea734259..bca8cea8 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
@@ -178,4 +178,12 @@ public interface SysUserMapper extends BaseMapper {
//个人中心我的账户修改个人信息
@Update("UPDATE sys_user SET realname = #{realname},sex=#{sex},birthday=#{birthday},phone=#{phone},email=#{email} WHERE id = #{id} ")
void updateneed(String id, String sex, String birthday, String realname, String phone, String email);
+
+ List getscgoods(String userid);
+
+ @Select("SELECT zf.name FROM customercollectgoods AS crg LEFT JOIN goods_fabric AS gf ON crg.goods_id = gf.goods_id LEFT JOIN zy_fabric AS zf ON gf.fabric_id = zf.id WHERE crg.id=#{id}")
+ List getscgoodml(String id);
+
+ @Select("SELECT za.contents FROM customercollectgoods AS crg LEFT JOIN goods_accessories AS ga ON crg.goods_id = ga.goods_id LEFT JOIN zy_accessories AS za ON ga.accessories_id = za.id where crg.id=#{id}")
+ List getscgoodfi(String id);
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml
index fb4af157..933fa6d0 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml
@@ -198,4 +198,14 @@ WHERE og.id=#{id}
+
+
+
+
+
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
index ff1d60e5..e7e12a85 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
@@ -272,4 +272,11 @@ public interface ISysUserService extends IService {
SysUser getneeduser(String id);
void updateneed(String id, String sex, String birthday, String realname, String phone, String email);
+
+ //此处用于个人中心获取收藏商品的信息
+ List getscgoods(String userid);
+ //此处用于个人中心获取收藏商品的面料
+ List getscgoodml(String id);
+ //此处用于个人中心获取收藏商品的辅料
+ List getscgoodfi(String id);
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
index 3d1f8dcd..095598c2 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
@@ -23,6 +23,7 @@ import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.system.vo.Grzx1;
import org.jeecg.modules.system.vo.Grzx2;
+
import org.jeecg.modules.system.vo.SysUserDepVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
@@ -588,4 +589,19 @@ public class SysUserServiceImpl extends ServiceImpl impl
userMapper.updateneed(id,sex,birthday,realname,phone,email);
}
+ @Override
+ public List getscgoods(String userid) {
+ return userMapper.getscgoods(userid);
+ }
+
+ @Override
+ public List getscgoodml(String id) {
+ return userMapper.getscgoodml(id);
+ }
+
+ @Override
+ public List getscgoodfi(String id) {
+ return userMapper.getscgoodfi(id);
+ }
+
}