diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/controller/CookDishesController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/controller/CookDishesController.java index d80f2d9..b49ea3a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/controller/CookDishesController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/controller/CookDishesController.java @@ -1,6 +1,8 @@ package com.bonus.canteen.core.cook.controller; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; @@ -101,7 +103,18 @@ public class CookDishesController extends BaseController { @SysLog(title = "菜品信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除菜品信息") @PostMapping("/del/{dishesIds}") public AjaxResult remove(@PathVariable Long[] dishesIds) { - return toAjax(cookDishesService.deleteCookDishesByDishesIds(dishesIds)); + try{ + Map map=new HashMap<>(); + map=cookDishesService.deleteCookDishesByDishesIds(dishesIds); + String res=(String) map.get("msg"); + int data=(int) map.get("data"); + if(data==0){ + return AjaxResult.error(res); + } + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + return AjaxResult.success(); } @PostMapping({"/import/check"}) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookDishesMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookDishesMapper.java index 69cc8c1..1af3df6 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookDishesMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookDishesMapper.java @@ -104,7 +104,7 @@ public interface CookDishesMapper { * @return 菜品计划详情id列表 */ List selectDishPlanDetailIdByDishId(@Param("dishesIds") Long[] dishesIds,@Param("applyDate") String applyDate); - + List selectRecipeDishesByDishId(@Param("dishesId") Long dishesId); /** * 批量删除菜品信息 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/ICookDishesService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/ICookDishesService.java index 35103bd..702e250 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/ICookDishesService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/ICookDishesService.java @@ -1,6 +1,8 @@ package com.bonus.canteen.core.cook.service; import java.util.List; +import java.util.Map; + import com.bonus.canteen.core.cook.domain.CookDishes; import com.bonus.canteen.core.cook.dto.AppletDishesDetailDTO; import com.bonus.canteen.core.cook.dto.DishesConvertDTO; @@ -56,7 +58,7 @@ public interface ICookDishesService { * @param dishesIds 需要删除的菜品信息主键集合 * @return 结果 */ - public int deleteCookDishesByDishesIds(Long[] dishesIds); + public Map deleteCookDishesByDishesIds(Long[] dishesIds); /** * 删除菜品信息信息 diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java index f9cfec1..df16c5c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java @@ -205,14 +205,31 @@ public class CookDishesServiceImpl implements ICookDishesService { * @return 结果 */ @Override - public int deleteCookDishesByDishesIds(Long[] dishesIds) { - //查询所有当天及之后的菜品计划detailId - List detailIdList = cookDishesMapper.selectDishPlanDetailIdByDishId(dishesIds, DateUtils.getDate()); - //删除菜品计划cook_recipe_dishes 菜品计划菜品关联表 - if (detailIdList != null && !detailIdList.isEmpty()) { - cookDishesMapper.deleteCookDishesByDishPlanDetailIds(detailIdList, dishesIds); + public Map deleteCookDishesByDishesIds(Long[] dishesIds) { + Map map=new HashMap<>(); + String res=""; + for(Long lg:dishesIds){ + List cookDishes=cookDishesMapper.selectRecipeDishesByDishId(lg); + if(cookDishes!=null&&cookDishes.size()>0){ + res=res+cookDishes.get(0).getDishesName()+" "; + } } - return cookDishesMapper.deleteCookDishesByDishesIds(dishesIds); + if(!"".equals(res)){ + res=res+"已加入菜谱!"; + map.put("msg",res); + map.put("data",0); + }else{ + //查询所有当天及之后的菜品计划detailId + List detailIdList = cookDishesMapper.selectDishPlanDetailIdByDishId(dishesIds, DateUtils.getDate()); + //删除菜品计划cook_recipe_dishes 菜品计划菜品关联表 + if (detailIdList != null && !detailIdList.isEmpty()) { + cookDishesMapper.deleteCookDishesByDishPlanDetailIds(detailIdList, dishesIds); + } + cookDishesMapper.deleteCookDishesByDishesIds(dishesIds); + map.put("msg",res); + map.put("data",1); + } + return map; } /** diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookMaterialServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookMaterialServiceImpl.java index cfe2f0f..9164895 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookMaterialServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookMaterialServiceImpl.java @@ -76,23 +76,25 @@ public class CookMaterialServiceImpl implements ICookMaterialService { public int insertCookMaterial(CookMaterial cookMaterial) { cookMaterial.setCreateTime(DateUtils.getNowDate()); try { - if (StringUtils.isBlank(cookMaterial.getMaterialCode())){ + if (StringUtils.isBlank(cookMaterial.getMaterialCode())) { throw new ServiceException("请输入原料编码"); } - if (StringUtils.isBlank(cookMaterial.getMaterialName())){ + if (StringUtils.isBlank(cookMaterial.getMaterialName())) { throw new ServiceException("请输入原料名称"); } - if (StringUtils.isNull(cookMaterial.getMaterialTypeId()) || cookMaterial.getMaterialTypeId() == 0L){ + if (StringUtils.isNull(cookMaterial.getMaterialTypeId()) || cookMaterial.getMaterialTypeId() == 0L) { throw new ServiceException("请选择原料类别"); } - if (cookMaterial.getGoodsType().equals(1L) && (StringUtils.isNull(cookMaterial.getNutritionId()) || cookMaterial.getNutritionId() == 0L)){ + if (cookMaterial.getGoodsType().equals(1L) && (StringUtils.isNull(cookMaterial.getNutritionId()) || cookMaterial.getNutritionId() == 0L)) { throw new ServiceException("请选择营养信息名称"); } - if (cookMaterialMapper.checkIsExistByCode(cookMaterial.getMaterialCode(), null,cookMaterial.getGoodsType()) > 0) { - throw new ServiceException("该原料编码已存在"); + if (cookMaterialMapper.checkIsExistByCode(cookMaterial.getMaterialCode(), null, cookMaterial.getGoodsType()) > 0) { + String name = cookMaterial.getGoodsType() == 1 ? "原料" : "商品"; + throw new ServiceException("该" + name + "编码已存在"); } - if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), null,cookMaterial.getGoodsType()) > 0) { - throw new ServiceException("该原料名称已存在"); + if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), null, cookMaterial.getGoodsType()) > 0) { + String name = cookMaterial.getGoodsType() == 1 ? "原料" : "商品"; + throw new ServiceException("该" + name + "名称已存在"); } cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? 0L : cookMaterial.getSalePrice() * 100); cookMaterial.setUnitPrice(Objects.isNull(cookMaterial.getUnitPrice()) ? 0L : cookMaterial.getUnitPrice() * 100); @@ -112,26 +114,28 @@ public class CookMaterialServiceImpl implements ICookMaterialService { public int updateCookMaterial(CookMaterial cookMaterial) { cookMaterial.setUpdateTime(DateUtils.getNowDate()); try { - if (StringUtils.isNull(cookMaterial.getMaterialId())){ + if (StringUtils.isNull(cookMaterial.getMaterialId())) { throw new ServiceException("未携带原料ID"); } - if (StringUtils.isBlank(cookMaterial.getMaterialCode())){ + if (StringUtils.isBlank(cookMaterial.getMaterialCode())) { throw new ServiceException("请输入原料编码"); } - if (StringUtils.isBlank(cookMaterial.getMaterialName())){ + if (StringUtils.isBlank(cookMaterial.getMaterialName())) { throw new ServiceException("请输入原料名称"); } - if (StringUtils.isNull(cookMaterial.getMaterialTypeId()) || cookMaterial.getMaterialTypeId() == 0L){ + if (StringUtils.isNull(cookMaterial.getMaterialTypeId()) || cookMaterial.getMaterialTypeId() == 0L) { throw new ServiceException("请选择原料类别"); } - if (cookMaterial.getGoodsType().equals(1L) && (StringUtils.isNull(cookMaterial.getNutritionId()) || cookMaterial.getNutritionId() == 0L)){ + if (cookMaterial.getGoodsType().equals(1L) && (StringUtils.isNull(cookMaterial.getNutritionId()) || cookMaterial.getNutritionId() == 0L)) { throw new ServiceException("请选择营养信息名称"); } - if (cookMaterialMapper.checkIsExistByCode(cookMaterial.getMaterialCode(), cookMaterial.getMaterialId(),cookMaterial.getGoodsType()) > 0) { - throw new ServiceException("该原料编码已存在"); + if (cookMaterialMapper.checkIsExistByCode(cookMaterial.getMaterialCode(), cookMaterial.getMaterialId(), cookMaterial.getGoodsType()) > 0) { + String name = cookMaterial.getGoodsType() == 1 ? "原料" : "商品"; + throw new ServiceException("该" + name + "编码已存在"); } - if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), cookMaterial.getMaterialId(),cookMaterial.getGoodsType()) > 0) { - throw new ServiceException("该原料名称已存在"); + if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), cookMaterial.getMaterialId(), cookMaterial.getGoodsType()) > 0) { + String name = cookMaterial.getGoodsType() == 1 ? "原料" : "商品"; + throw new ServiceException("该" + name + "名称已存在"); } cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? 0L : cookMaterial.getSalePrice() * 100); cookMaterial.setUnitPrice(Objects.isNull(cookMaterial.getUnitPrice()) ? 0L : cookMaterial.getUnitPrice() * 100); @@ -150,7 +154,7 @@ public class CookMaterialServiceImpl implements ICookMaterialService { @Override public int deleteCookMaterialByMaterialIds(Long[] materialIds) { // 判断该原料信息是否被使用 - if (cookMaterialMapper.checkIsUse(materialIds) > 0){ + if (cookMaterialMapper.checkIsUse(materialIds) > 0) { throw new ServiceException("该原料信息被使用,不允许删除!"); } return cookMaterialMapper.deleteCookMaterialByMaterialIds(materialIds); @@ -169,20 +173,20 @@ public class CookMaterialServiceImpl implements ICookMaterialService { @Override public List checkMaterialAndPriceVO(MaterialAndPriceDTO materialAndPriceDTO) { - if(Objects.isNull(materialAndPriceDTO.getMaterialIds()) || materialAndPriceDTO.getMaterialIds().length == 0){ + if (Objects.isNull(materialAndPriceDTO.getMaterialIds()) || materialAndPriceDTO.getMaterialIds().length == 0) { throw new ServiceException("请携带原料ID"); } - if(MaterialPriceEnum.getKey("根据系统设置自动获取").equals(materialAndPriceDTO.getType())){ + if (MaterialPriceEnum.getKey("根据系统设置自动获取").equals(materialAndPriceDTO.getType())) { String value = ImsSettingEnum.getValue("采购计划参考价"); ImsSetting imsSetting = imsSettingMapper.selectImsSettingByName(value); - if(Objects.isNull(imsSetting) || StringUtils.isBlank(imsSetting.getItemValue())){ + if (Objects.isNull(imsSetting) || StringUtils.isBlank(imsSetting.getItemValue())) { throw new ServiceException("请先配置采购计划参考价"); } materialAndPriceDTO.setType(Integer.parseInt(imsSetting.getItemValue())); } - if(MaterialPriceEnum.getKey("参考上次采购价格").equals(materialAndPriceDTO.getType())){ - return cookMaterialMapper.checkMaterialAndSetPrice(materialAndPriceDTO.getMaterialIds()); - }else{ + if (MaterialPriceEnum.getKey("参考上次采购价格").equals(materialAndPriceDTO.getType())) { + return cookMaterialMapper.checkMaterialAndSetPrice(materialAndPriceDTO.getMaterialIds()); + } else { return cookMaterialMapper.checkMaterialAndPurchasePrice(materialAndPriceDTO.getMaterialIds()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPersonMedicalReportController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPersonMedicalReportController.java index 32ff02a..5854bab 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPersonMedicalReportController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/controller/HealthPersonMedicalReportController.java @@ -3,9 +3,7 @@ package com.bonus.canteen.core.health.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; -import com.bonus.canteen.core.health.domain.HealthChronic; -import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails; -import com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails; +import com.bonus.canteen.core.health.domain.*; import com.bonus.common.log.enums.OperaType; //import com.bonus.canteen.core.health.common.annotation.PreventRepeatSubmit; import io.swagger.annotations.Api; @@ -21,7 +19,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.bonus.common.log.annotation.SysLog; import com.bonus.common.security.annotation.RequiresPermissions; -import com.bonus.canteen.core.health.domain.HealthPersonMedicalReport; import com.bonus.canteen.core.health.service.IHealthPersonMedicalReportService; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; @@ -47,9 +44,9 @@ public class HealthPersonMedicalReportController extends BaseController { @ApiOperation(value = "查询人员体检报告列表") //@RequiresPermissions("health:report:list") @GetMapping("/list") - public TableDataInfo list(HealthPersonMedicalReport healthPersonMedicalReport) { + public TableDataInfo list(HealthPersonInfo healthPersonMedicalReport) { startPage(); - List list = healthPersonMedicalReportService.selectHealthPersonMedicalReportList(healthPersonMedicalReport); + List list = healthPersonMedicalReportService.selectHealthPersonMedicalReportList2(healthPersonMedicalReport); return getDataTable(list); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/domain/HealthPersonMedicalReport.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/domain/HealthPersonMedicalReport.java index 4a69f5f..9b914da 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/domain/HealthPersonMedicalReport.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/domain/HealthPersonMedicalReport.java @@ -49,6 +49,7 @@ public class HealthPersonMedicalReport extends BaseEntity { @Excel(name = "体检模板id") @ApiModelProperty(value = "体检模板id") private Long medicalTemplateId; - + private String encryptedSearchValue; + private String articleTitle; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/mapper/HealthPersonMedicalReportMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/mapper/HealthPersonMedicalReportMapper.java index e536432..5091b22 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/mapper/HealthPersonMedicalReportMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/mapper/HealthPersonMedicalReportMapper.java @@ -2,10 +2,7 @@ package com.bonus.canteen.core.health.mapper; import java.util.List; -import com.bonus.canteen.core.health.domain.HealthMedicalReportDetail; -import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails; -import com.bonus.canteen.core.health.domain.HealthPersonMedicalReport; -import com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails; +import com.bonus.canteen.core.health.domain.*; import org.apache.ibatis.annotations.Param; /** @@ -30,7 +27,7 @@ public interface HealthPersonMedicalReportMapper { * @return 人员体检报告集合 */ public List selectHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport); - + public List selectHealthPersonMedicalReportList2(HealthPersonInfo healthPersonMedicalReport); /** * 新增人员体检报告 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/IHealthPersonMedicalReportService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/IHealthPersonMedicalReportService.java index 0733a09..5cdd69c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/IHealthPersonMedicalReportService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/IHealthPersonMedicalReportService.java @@ -3,6 +3,7 @@ package com.bonus.canteen.core.health.service; import java.util.List; import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails; +import com.bonus.canteen.core.health.domain.HealthPersonInfo; import com.bonus.canteen.core.health.domain.HealthPersonMedicalReport; import com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails; @@ -29,7 +30,7 @@ public interface IHealthPersonMedicalReportService { */ public List selectHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport); - + public List selectHealthPersonMedicalReportList2(HealthPersonInfo healthPersonMedicalReport); /** * 新增人员体检报告 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPersonMedicalReportServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPersonMedicalReportServiceImpl.java index 93f749f..bc07d4b 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPersonMedicalReportServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/health/service/impl/HealthPersonMedicalReportServiceImpl.java @@ -3,15 +3,13 @@ package com.bonus.canteen.core.health.service.impl; import java.util.ArrayList; import java.util.List; -import com.bonus.canteen.core.health.domain.HealthMedicalReportDetail; -import com.bonus.canteen.core.health.domain.HealthMedicalReportDetails; -import com.bonus.canteen.core.health.domain.HealthPersonMedicalReportDetails; +import com.bonus.canteen.core.health.domain.*; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.houqin.utils.SM4EncryptUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.bonus.canteen.core.health.mapper.HealthPersonMedicalReportMapper; -import com.bonus.canteen.core.health.domain.HealthPersonMedicalReport; import com.bonus.canteen.core.health.service.IHealthPersonMedicalReportService; /** @@ -44,9 +42,16 @@ public class HealthPersonMedicalReportServiceImpl implements IHealthPersonMedica */ @Override public List selectHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport) { + String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(healthPersonMedicalReport.getArticleTitle()); + healthPersonMedicalReport.setEncryptedSearchValue(encryptedSearchValue); return healthPersonMedicalReportMapper.selectHealthPersonMedicalReportList(healthPersonMedicalReport); } - + @Override + public List selectHealthPersonMedicalReportList2(HealthPersonInfo healthPersonMedicalReport) { + String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(healthPersonMedicalReport.getArticleTitle()); + healthPersonMedicalReport.setEncryptedSearchValue(encryptedSearchValue); + return healthPersonMedicalReportMapper.selectHealthPersonMedicalReportList2(healthPersonMedicalReport); + } /** * 新增人员体检报告 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/bean/BodyMeasurement.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/bean/BodyMeasurement.java index 180b777..f302424 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/bean/BodyMeasurement.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/bean/BodyMeasurement.java @@ -10,6 +10,8 @@ import lombok.ToString; @AllArgsConstructor @ToString public class BodyMeasurement { + private String phone; + private String userCode; private String machineId; private String userId; private String sex; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/controller/HealthMachineController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/controller/HealthMachineController.java index 04e0853..74a2c39 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/controller/HealthMachineController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/controller/HealthMachineController.java @@ -36,6 +36,9 @@ public class HealthMachineController extends BaseController { //从数据库查询是否存在当前手机 dto.setPhoneNumber(SM4EncryptUtils.sm4Encrypt(dto.getPhoneNumber())); UserData userData = healthMachineMapper.checkIsExistCurrentUser(dto); + if (userData == null){ + userData = healthMachineMapper.checkIsExistCurrentSysUser(dto);; + } if (userData == null){ userData = new UserData("-1","外部人员","man","",18,true); } @@ -49,6 +52,13 @@ public class HealthMachineController extends BaseController { if (MINUS_ONE.equals(dto.getUserId())){ return JSON.toJSONString(BodyResponse.success()); } + //查询用户编码和手机号 + BodyMeasurement user = healthMachineMapper.selectUserById(dto.getUserId()); + if (user == null){ + user = healthMachineMapper.selectSysUserById(dto.getUserId()); + } + dto.setPhone(user.getPhone()); + dto.setUserCode(user.getUserCode()); healthMachineMapper.addPhysicalExaminationData(dto); }catch (Exception e){ return JSON.toJSONString(BodyResponse.fail("上传数据失败",500,"上传数据失败")); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/mapper/HealthMachineMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/mapper/HealthMachineMapper.java index e0ab9a4..58d33a4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/mapper/HealthMachineMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/mapper/HealthMachineMapper.java @@ -21,4 +21,10 @@ public interface HealthMachineMapper { * @param dto 入参 */ void addPhysicalExaminationData(@Param("dto") BodyMeasurement dto); + + BodyMeasurement selectUserById(String userId); + + UserData checkIsExistCurrentSysUser(UserDTO dto); + + BodyMeasurement selectSysUserById(String userId); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/PurchaseContractController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/PurchaseContractController.java index b9fd164..f7f6cf0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/PurchaseContractController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/PurchaseContractController.java @@ -127,4 +127,13 @@ public class PurchaseContractController extends BaseController { public AjaxResult remove(@PathVariable Long[] contractIds) { return toAjax(purchaseContractService.deletePurchaseContractByContractIds(contractIds)); } + /** + * 作废采购合同主 + */ + @ApiOperation(value = "作废采购合同") + @SysLog(title = "采购合同主", businessType = OperaType.DELETE, logType = 1,module = "采购合同->作废采购合同主") + @PostMapping("/nullify/{contractIds}") + public AjaxResult nullify(@PathVariable Long[] contractIds) { + return toAjax(purchaseContractService.nullifyPurchaseContractByContractIds(contractIds)); + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/PurchasePlan.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/PurchasePlan.java index 0445972..c614b81 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/PurchasePlan.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/PurchasePlan.java @@ -155,5 +155,13 @@ public class PurchasePlan extends BaseEntity { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endDateTime; + @ApiModelProperty("合同开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String startTime; + + @ApiModelProperty("合同结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String endTime; + private List purchasePlanDetailList; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/OrderGoodsQuery.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/OrderGoodsQuery.java index bae7814..db1a8f0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/OrderGoodsQuery.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/OrderGoodsQuery.java @@ -90,7 +90,7 @@ public class OrderGoodsQuery implements Serializable { @ApiModelProperty(value = "是否全部入库 1是2否") private String isIntoInventory; - private String warehouseId; + private Long warehouseId; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/PurchasePlanQuery.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/PurchasePlanQuery.java index c1467a5..6e61767 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/PurchasePlanQuery.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/PurchasePlanQuery.java @@ -47,10 +47,17 @@ public class PurchasePlanQuery implements Serializable { @ApiModelProperty("开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime startDateTime; + private String startDateTime; @ApiModelProperty("结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime endDateTime; + private String endDateTime; + @ApiModelProperty("合同开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String startTime; + + @ApiModelProperty("合同结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String endTime; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/CheckInventoryMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/CheckInventoryMapper.java index d719677..057d735 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/CheckInventoryMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/CheckInventoryMapper.java @@ -2,6 +2,7 @@ package com.bonus.canteen.core.ims.mapper; import java.util.List; import com.bonus.canteen.core.ims.domain.CheckInventory; +import com.bonus.canteen.core.ims.domain.ImsIntoInventoryDetail; import com.bonus.canteen.core.ims.dto.CheckInventoryMaterialDTO; import com.bonus.canteen.core.ims.dto.CheckInventoryPageDTO; import com.bonus.canteen.core.ims.vo.CheckInventoryMaterialVO; @@ -69,4 +70,6 @@ public interface CheckInventoryMapper { List getDrpCheckInventoryPage(@Param("content") CheckInventoryPageDTO content); + void setData(String sqld); + List getData(String sqld); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ImsIntoInventoryMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ImsIntoInventoryMapper.java index 111b1c0..91a9068 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ImsIntoInventoryMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ImsIntoInventoryMapper.java @@ -95,4 +95,6 @@ public interface ImsIntoInventoryMapper { public ImsIntoInventoryDetailVO selectImsIntoInventoryDetailListByIntoDetailId(@Param("intoDetailId") Long intoDetailId); public List selectDetailListByWarehouseIdAndMaterialId(ImsIntoInventory imsIntoInventory); + + public List selectImsIntoInventoryDetailListByInventoryIdD(Long inventoryId); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/PurchaseContractMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/PurchaseContractMapper.java index ace1374..b7281f7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/PurchaseContractMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/PurchaseContractMapper.java @@ -58,4 +58,12 @@ public interface PurchaseContractMapper { * @return 结果 */ public int deletePurchaseContractByContractIds(Long[] contractIds); + + /** + * 作废采购合同 + * + * @param contractIds 需要作废的数据主键集合 + * @return 结果 + */ + int nullifyPurchaseContractByContractId(Long[] contractIds); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IPurchaseContractService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IPurchaseContractService.java index ebc50d9..0568f79 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IPurchaseContractService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IPurchaseContractService.java @@ -60,4 +60,12 @@ public interface IPurchaseContractService { * @return 结果 */ public int deletePurchaseContractByContractId(Long contractId); + + /** + * 作废采购合同 + * + * @param contractIds 需要作废的采购合同主键集合 + * @return 结果 + */ + int nullifyPurchaseContractByContractIds(Long[] contractIds); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/CheckInventoryServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/CheckInventoryServiceImpl.java index f6c83ab..7d3819f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/CheckInventoryServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/CheckInventoryServiceImpl.java @@ -2,6 +2,7 @@ package com.bonus.canteen.core.ims.service.impl; import java.math.BigDecimal; import java.math.RoundingMode; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; @@ -12,6 +13,12 @@ import cn.hutool.core.date.DateTime; import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.util.ObjectUtil; import com.bonus.canteen.core.ims.domain.CheckInventoryDetail; +import com.bonus.canteen.core.ims.domain.ImsIntoInventoryDetail; +import com.bonus.canteen.core.ims.domain.param.ImsIntoInventoryAdd; +import com.bonus.canteen.core.ims.domain.param.ImsIntoInventoryDetailAdd; +import com.bonus.canteen.core.ims.domain.param.ImsOutInventoryAdd; +import com.bonus.canteen.core.ims.domain.param.ImsOutInventoryDetailAdd; +import com.bonus.canteen.core.ims.domain.vo.ImsIntoInventoryDetailVO; import com.bonus.canteen.core.ims.dto.CheckDetailDraftAddDTO; import com.bonus.canteen.core.ims.dto.CheckInventoryDraftAddDTO; import com.bonus.canteen.core.ims.dto.CheckInventoryMaterialDTO; @@ -21,6 +28,9 @@ import com.bonus.canteen.core.ims.enums.CheckWayEnum; import com.bonus.canteen.core.ims.enums.DealWithStatusEnum; import com.bonus.canteen.core.ims.enums.IntoInventoryStatusEnum; import com.bonus.canteen.core.ims.mapper.CheckInventoryDetailMapper; +import com.bonus.canteen.core.ims.mapper.ImsIntoInventoryMapper; +import com.bonus.canteen.core.ims.service.IImsIntoInventoryService; +import com.bonus.canteen.core.ims.service.IImsOutInventoryService; import com.bonus.canteen.core.ims.utils.NoGenerateUtils; import com.bonus.canteen.core.ims.vo.CheckInventoryAddVO; import com.bonus.canteen.core.ims.vo.CheckInventoryMaterialVO; @@ -52,6 +62,14 @@ public class CheckInventoryServiceImpl implements ICheckInventoryService { @Resource private CheckInventoryDetailMapper checkDetailMapper; + @Resource + private ImsIntoInventoryMapper imsintoInventoryMapper; + + @Autowired + private IImsOutInventoryService iimsOutInventoryService; + + @Autowired + private IImsIntoInventoryService iimsIntoInventoryService; /** * 查询库存盘点 * @@ -200,7 +218,73 @@ public class CheckInventoryServiceImpl implements ICheckInventoryService { checkInventory.setTotalProfitLoss(totalProfitLoss.toString()); checkInventory.setCreateTime(DateUtils.getNowDate()); checkInventory.setCreateBy(SecurityUtils.getUsername()); - checkInventoryMapper.insertCheckInventory(checkInventory); + int dd=checkInventoryMapper.insertCheckInventory(checkInventory); + + if(dd>0){ + for(CheckDetailDraftAddDTO vo:detailList){ + //盘点后实时修改库存数量 + + BigDecimal diffnum=vo.getDifferNum(); + if(diffnum.compareTo(new BigDecimal("0"))>0){ + //增加库存 + BigDecimal purNum=new BigDecimal("0"); + Long inventoryId=0L; + + ImsIntoInventoryAdd imsIntoInventoryAdd =new ImsIntoInventoryAdd(); + imsIntoInventoryAdd.setWarehouseId(checkInventory.getWarehouseId()); + imsIntoInventoryAdd.setIntoDate(LocalDateTime.now()); + imsIntoInventoryAdd.setTotalNum(vo.getActualNum()); + imsIntoInventoryAdd.setIntoType(1L); + imsIntoInventoryAdd.setStatus(2L); + imsIntoInventoryAdd.setTotalAmount((long)vo.getActualAmount()); + + List imsintoInventoryDetailAddList=new ArrayList<>(); + ImsIntoInventoryDetailAdd imsintoInventoryDetailAdd=new ImsIntoInventoryDetailAdd(); + List imsintoInventoryDetails= imsintoInventoryMapper.selectImsIntoInventoryDetailListByInventoryIdD(vo.getInventoryId()); + if(imsintoInventoryDetails!=null&&imsintoInventoryDetails.size()>0){ + imsintoInventoryDetailAdd.setMaterialId(imsintoInventoryDetails.get(0).getMaterialId()); + imsintoInventoryDetailAdd.setSupplierId(imsintoInventoryDetails.get(0).getSupplierId()); + imsintoInventoryDetailAdd.setUnitId(imsintoInventoryDetails.get(0).getUnitId()); + imsintoInventoryDetailAdd.setUnitPrice((long)vo.getPrice()); + imsintoInventoryDetailAdd.setTotalPrice((long)vo.getActualAmount()); + imsintoInventoryDetailAdd.setPurNum(vo.getDifferNum()); + imsintoInventoryDetailAdd.setProductDate(imsintoInventoryDetails.get(0).getProductDate()); + imsintoInventoryDetailAdd.setExpireTime(imsintoInventoryDetails.get(0).getExpireTime()); + imsintoInventoryDetailAddList.add(imsintoInventoryDetailAdd); + imsIntoInventoryAdd.setImsIntoInventoryDetailAddList(imsintoInventoryDetailAddList); + try{ + iimsIntoInventoryService.insertImsIntoInventory(imsIntoInventoryAdd); + }catch (Exception e){ + e.printStackTrace(); + } + } + + + }else if(diffnum.compareTo(new BigDecimal("0"))<0){ + //减少库存 + ImsOutInventoryAdd imsOutInventoryAdd=new ImsOutInventoryAdd(); + imsOutInventoryAdd.setWarehouseId(checkInventory.getWarehouseId()); + imsOutInventoryAdd.setOutDate(LocalDateTime.now()); + imsOutInventoryAdd.setTotalNum(vo.getActualNum()); + imsOutInventoryAdd.setOutType(2L); + imsOutInventoryAdd.setStatus(2L); + imsOutInventoryAdd.setTotalAmount((long)vo.getActualAmount()); + + List imsoutInventoryDetailAddList=new ArrayList<>(); + ImsOutInventoryDetailAdd imsoutInventoryDetailAdd=new ImsOutInventoryDetailAdd(); + imsoutInventoryDetailAdd.setInventoryId(vo.getInventoryId()); + imsoutInventoryDetailAdd.setFetchNum(vo.getDifferNum().abs()); + imsoutInventoryDetailAdd.setTotalPrice((long)vo.getActualAmount()); + imsoutInventoryDetailAddList.add(imsoutInventoryDetailAdd); + imsOutInventoryAdd.setImsOutInventoryDetailAddList(imsoutInventoryDetailAddList); + try{ + iimsOutInventoryService.insertImsOutInventory(imsOutInventoryAdd); + }catch (Exception e){ + e.printStackTrace(); + } + } + } + } CheckDetailDraftAddDTO temp; for(Iterator var9 = detailList.iterator(); var9.hasNext(); totalProfitLoss = totalProfitLoss.add(new BigDecimal(temp.getDifferAmount()))) { diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsIntoInventoryServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsIntoInventoryServiceImpl.java index 8e0e88c..e1a185f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsIntoInventoryServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsIntoInventoryServiceImpl.java @@ -74,7 +74,9 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService @Override public ImsIntoInventoryVO selectImsIntoInventoryByIntoId(Long intoId) { - return imsIntoInventoryMapper.selectImsIntoInventoryByIntoId(intoId); + ImsIntoInventoryVO vo=new ImsIntoInventoryVO(); + vo=imsIntoInventoryMapper.selectImsIntoInventoryByIntoId(intoId); + return vo; } /** diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java index d828c20..d5352f4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java @@ -155,7 +155,7 @@ public class ImsOutInventoryServiceImpl implements IImsOutInventoryService imsOutInventory.setOutCode(imsOutInventoryVO.getOutCode()); imsOutInventoryMapper.deleteImsOutInventoryDetailByOutId(imsOutInventory.getOutId()); insertImsOutInventoryDetail(imsOutInventoryUpdate.getImsOutInventoryDetailAddList(), imsOutInventory); - return 0; + return 1; } /** diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/OrderGoodsServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/OrderGoodsServiceImpl.java index 1cb5ef7..cac4fd5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/OrderGoodsServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/OrderGoodsServiceImpl.java @@ -203,13 +203,14 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService { } } } - InspectGoodsSum inspectGoodsSum = inspectGoodsService - .getInspectGoodsListByOrderGoodsCode(orderGoodsVO.getOrderGoodsCode()); - if(Objects.nonNull(inspectGoodsSum) && Objects.nonNull(inspectGoodsSum.getTotalQualifiedNum())) { - orderGoodsVO.setTotalQualifiedNum(inspectGoodsSum.getTotalQualifiedNum()); - }else{ - orderGoodsVO.setTotalQualifiedNum(BigDecimal.ZERO); - } + + } + InspectGoodsSum inspectGoodsSum = inspectGoodsService + .getInspectGoodsListByOrderGoodsCode(orderGoodsVO.getOrderGoodsCode()); + if(Objects.nonNull(inspectGoodsSum) && Objects.nonNull(inspectGoodsSum.getTotalQualifiedNum())) { + orderGoodsVO.setTotalQualifiedNum(inspectGoodsSum.getTotalQualifiedNum()); + }else{ + orderGoodsVO.setTotalQualifiedNum(BigDecimal.ZERO); } } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/PurchaseContractServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/PurchaseContractServiceImpl.java index 22e53a1..1f0c5ed 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/PurchaseContractServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/PurchaseContractServiceImpl.java @@ -96,6 +96,9 @@ public class PurchaseContractServiceImpl implements IPurchaseContractService { if (PurchaseContractStatusEnum.END.getKey().equals(contract.getContractStatus())) { contract.setContractStatus(PurchaseContractStatusEnum.END.getKey()); }else { + if (contract.getCommitStatus() == 1){ + return; + } if(!LocalDateTime.now().isBefore(contract.getContractStartTime()) && !LocalDateTime.now().isAfter(contract.getContractEndTime())) { contract.setContractStatus(PurchaseContractStatusEnum.TAKE_EFFECT.getKey()); @@ -208,4 +211,15 @@ public class PurchaseContractServiceImpl implements IPurchaseContractService { inspectGoodsDetailService.deletePurchaseContractDetailByContractId(contractId); return purchaseContractMapper.deletePurchaseContractByContractId(contractId); } + + /** + * 作废采购合同 + * + * @param contractIds 需要作废的采购合同主键集合 + * @return 结果 + */ + @Override + public int nullifyPurchaseContractByContractIds(Long[] contractIds) { + return purchaseContractMapper.nullifyPurchaseContractByContractId(contractIds); + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/CheckInventoryPageVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/CheckInventoryPageVO.java index d8fafdc..94a7585 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/CheckInventoryPageVO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/CheckInventoryPageVO.java @@ -63,6 +63,8 @@ public class CheckInventoryPageVO { @ApiModelProperty("差异数") private String differNum; + @ApiModelProperty("差异总额") + private String differAmount; @ApiModelProperty("当前用户是否可以审批") private Boolean curUserApprove; @ApiModelProperty("签名") @@ -314,4 +316,12 @@ public class CheckInventoryPageVO { public void setUpdateTime(LocalDateTime updateTime) { this.updateTime = updateTime; } + + public String getDifferAmount() { + return differAmount; + } + + public void setDifferAmount(String differAmount) { + this.differAmount = differAmount; + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialPageVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialPageVO.java index efc4f0d..b7474d0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialPageVO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialPageVO.java @@ -47,7 +47,7 @@ public class FetchMaterialPageVO { @ApiModelProperty("领料人id") private Long fetchUserId; @ApiModelProperty("领料人") - private String fetchUserName; + private String fetchUser; @ApiModelProperty("审批状态(1待审核,2审批中,3审批通过,4审批不通过)") private Integer approveStatus; @ApiModelProperty("审批流程id") @@ -133,10 +133,6 @@ public class FetchMaterialPageVO { return this.fetchUserId; } - public String getFetchUserName() { - return this.fetchUserName; - } - public Integer getApproveStatus() { return this.approveStatus; } @@ -267,11 +263,6 @@ public class FetchMaterialPageVO { return this; } - public FetchMaterialPageVO setFetchUserName(final String fetchUserName) { - this.fetchUserName = fetchUserName; - return this; - } - public FetchMaterialPageVO setApproveStatus(final Integer approveStatus) { this.approveStatus = approveStatus; return this; @@ -321,4 +312,12 @@ public class FetchMaterialPageVO { this.curUserApprove = curUserApprove; return this; } + + public String getFetchUser() { + return fetchUser; + } + + public void setFetchUser(String fetchUser) { + this.fetchUser = fetchUser; + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/service/DataScreeningServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/service/DataScreeningServiceImpl.java index dbfd71f..534fdb9 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/service/DataScreeningServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/service/DataScreeningServiceImpl.java @@ -115,6 +115,11 @@ public class DataScreeningServiceImpl implements DataScreeningService { case DISH: //查询所有绑定的菜谱 List recipeIds = mapper.selectAllRecipeIds(); + if(recipeIds.isEmpty()){ + SingleModelVO singleModelVO = new SingleModelVO(); + singleModelVO.setNum(BigDecimal.ZERO); + return singleModelVO; + } return mapper.selectDish(date,recipeIds); default: return new SingleModelVO(); diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookDishesMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookDishesMapper.xml index f5d56cd..6ef6b67 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookDishesMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookDishesMapper.xml @@ -327,6 +327,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPersonMedicalReportMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPersonMedicalReportMapper.xml index 3b2a956..fc23000 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPersonMedicalReportMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/health/HealthPersonMedicalReportMapper.xml @@ -15,6 +15,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + + + + + + + + + + + + + select id, medical_id, user_id, medical_date, medical_mechanism, medical_template_id, create_by, create_time, update_by, update_time from health_person_medical_report @@ -31,7 +55,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by create_time desc - + @@ -20,4 +21,33 @@ values (#{dto.userId},#{dto.machineId},#{dto.sex},#{dto.age},#{dto.height},#{dto.weight},#{dto.bmi},#{dto.bodyFat},#{dto.muscle},#{dto.boneMass},#{dto.waterContent},#{dto.extwater},#{dto.protein} ,#{dto.metabolism},#{dto.fatLevel},#{dto.bodyAge}) + + + + + + \ No newline at end of file diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/CheckInventoryMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/CheckInventoryMapper.xml index 5d9d0d9..97063ed 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/CheckInventoryMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/CheckInventoryMapper.xml @@ -221,7 +221,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + ${sqld} + + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialMapper.xml index 92d88f5..781ddb4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialMapper.xml @@ -161,7 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dw.warehouse_name, a.fetch_material_time, a.fetch_user_id, - su.user_name AS fetch_user_name, + a.fetch_user AS fetchUser, a.approve_status, a.process_instance_id, a.fetch_user, diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsIntoInventoryMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsIntoInventoryMapper.xml index e1438a3..f4edba7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsIntoInventoryMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsIntoInventoryMapper.xml @@ -375,4 +375,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND inventory_num >= #{fetchNum} AND del_flag = '0' + + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsOutInventoryMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsOutInventoryMapper.xml index 575f92d..ce481c5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsOutInventoryMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsOutInventoryMapper.xml @@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select out_id, out_code, ioi.warehouse_id, out_date, ioi.fetch_user_id, total_num, out_type, ioi.status, order_id, total_amount, plan_id, fetch_material_id, goods_allocation_id, ioi.remark, ioi.del_flag, ioi.create_by, ioi.create_time, ioi.update_by, ioi.update_time, - iwi.warehouse_name, ioi.fetch_user, ba.area_id, ba.area_name + iwi.warehouse_name, ifnull(ioi.fetch_user,su.nick_name)as fetch_user, ba.area_id, ba.area_name from ims_out_inventory ioi left join ims_warehouse_info iwi on ioi.warehouse_id = iwi.warehouse_id left join basic_area ba on iwi.area_id = ba.area_id diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/OrderGoodsMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/OrderGoodsMapper.xml index 5d888a1..ea0f781 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/OrderGoodsMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/OrderGoodsMapper.xml @@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -51,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" iog.create_time, iog.update_by, iog.update_time, isr.supplier_name, iwi.warehouse_name, ba.area_name, bc.canteen_name, bs.stall_name, contract_code, iogps.pay_money_date, iogps.pay_money_style, iogps.collect_money_account, iogps.collect_money_account_name, - iogps.collect_money_bank, iog.supplier_id, iog.warehouse_id + iogps.collect_money_bank, iog.supplier_id, iog.warehouse_id,IFNULL(iig.delivery_total_num,0) as total_qualified_num from ims_order_goods iog left join ims_order_goods_pay_style iogps on iogps.order_goods_id = iog.order_goods_code left join ims_supplier isr on isr.supplier_id = iog.supplier_id @@ -59,19 +60,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join basic_area ba on ba.area_id = iog.area_id left join basic_canteen bc on bc.canteen_id = iog.canteen_id left join basic_stall bs on bs.stall_id = iog.stall_id + left join( + SELECT + relate_order_goods_id,status,sum(delivery_total_num) as delivery_total_num + from + ims_inspect_goods where `status` = 2 + GROUP BY relate_order_goods_id + )iig on iig.relate_order_goods_id = iog.order_goods_code