Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8f8970684d
|
|
@ -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<String,Object> 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"})
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public interface CookDishesMapper {
|
|||
* @return 菜品计划详情id列表
|
||||
*/
|
||||
List<Long> selectDishPlanDetailIdByDishId(@Param("dishesIds") Long[] dishesIds,@Param("applyDate") String applyDate);
|
||||
|
||||
List<CookDishes> selectRecipeDishesByDishId(@Param("dishesId") Long dishesId);
|
||||
/**
|
||||
* 批量删除菜品信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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<String,Object> deleteCookDishesByDishesIds(Long[] dishesIds);
|
||||
|
||||
/**
|
||||
* 删除菜品信息信息
|
||||
|
|
|
|||
|
|
@ -205,14 +205,31 @@ public class CookDishesServiceImpl implements ICookDishesService {
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCookDishesByDishesIds(Long[] dishesIds) {
|
||||
//查询所有当天及之后的菜品计划detailId
|
||||
List<Long> detailIdList = cookDishesMapper.selectDishPlanDetailIdByDishId(dishesIds, DateUtils.getDate());
|
||||
//删除菜品计划cook_recipe_dishes 菜品计划菜品关联表
|
||||
if (detailIdList != null && !detailIdList.isEmpty()) {
|
||||
cookDishesMapper.deleteCookDishesByDishPlanDetailIds(detailIdList, dishesIds);
|
||||
public Map<String,Object> deleteCookDishesByDishesIds(Long[] dishesIds) {
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
String res="";
|
||||
for(Long lg:dishesIds){
|
||||
List<CookDishes> 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<Long> 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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<MaterialAndPriceVO> 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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<HealthPersonMedicalReport> list = healthPersonMedicalReportService.selectHealthPersonMedicalReportList(healthPersonMedicalReport);
|
||||
List<HealthPersonInfo> list = healthPersonMedicalReportService.selectHealthPersonMedicalReportList2(healthPersonMedicalReport);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ public class HealthPersonMedicalReport extends BaseEntity {
|
|||
@Excel(name = "体检模板id")
|
||||
@ApiModelProperty(value = "体检模板id")
|
||||
private Long medicalTemplateId;
|
||||
|
||||
private String encryptedSearchValue;
|
||||
private String articleTitle;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<HealthPersonMedicalReport> selectHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport);
|
||||
|
||||
public List<HealthPersonInfo> selectHealthPersonMedicalReportList2(HealthPersonInfo healthPersonMedicalReport);
|
||||
/**
|
||||
* 新增人员体检报告
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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<HealthPersonMedicalReport> selectHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport);
|
||||
|
||||
|
||||
public List<HealthPersonInfo> selectHealthPersonMedicalReportList2(HealthPersonInfo healthPersonMedicalReport);
|
||||
/**
|
||||
* 新增人员体检报告
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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<HealthPersonMedicalReport> selectHealthPersonMedicalReportList(HealthPersonMedicalReport healthPersonMedicalReport) {
|
||||
String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(healthPersonMedicalReport.getArticleTitle());
|
||||
healthPersonMedicalReport.setEncryptedSearchValue(encryptedSearchValue);
|
||||
return healthPersonMedicalReportMapper.selectHealthPersonMedicalReportList(healthPersonMedicalReport);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HealthPersonInfo> selectHealthPersonMedicalReportList2(HealthPersonInfo healthPersonMedicalReport) {
|
||||
String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(healthPersonMedicalReport.getArticleTitle());
|
||||
healthPersonMedicalReport.setEncryptedSearchValue(encryptedSearchValue);
|
||||
return healthPersonMedicalReportMapper.selectHealthPersonMedicalReportList2(healthPersonMedicalReport);
|
||||
}
|
||||
/**
|
||||
* 新增人员体检报告
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,"上传数据失败"));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<PurchasePlanDetail> purchasePlanDetailList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public class OrderGoodsQuery implements Serializable {
|
|||
@ApiModelProperty(value = "是否全部入库 1是2否")
|
||||
private String isIntoInventory;
|
||||
|
||||
private String warehouseId;
|
||||
private Long warehouseId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<CheckInventoryPageVO> getDrpCheckInventoryPage(@Param("content") CheckInventoryPageDTO content);
|
||||
|
||||
void setData(String sqld);
|
||||
List<ImsIntoInventoryDetail> getData(String sqld);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,4 +95,6 @@ public interface ImsIntoInventoryMapper {
|
|||
public ImsIntoInventoryDetailVO selectImsIntoInventoryDetailListByIntoDetailId(@Param("intoDetailId") Long intoDetailId);
|
||||
|
||||
public List<ImsIntoInventoryDetailVO> selectDetailListByWarehouseIdAndMaterialId(ImsIntoInventory imsIntoInventory);
|
||||
|
||||
public List<ImsIntoInventoryDetailVO> selectImsIntoInventoryDetailListByInventoryIdD(Long inventoryId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,4 +58,12 @@ public interface PurchaseContractMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deletePurchaseContractByContractIds(Long[] contractIds);
|
||||
|
||||
/**
|
||||
* 作废采购合同
|
||||
*
|
||||
* @param contractIds 需要作废的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int nullifyPurchaseContractByContractId(Long[] contractIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,4 +60,12 @@ public interface IPurchaseContractService {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deletePurchaseContractByContractId(Long contractId);
|
||||
|
||||
/**
|
||||
* 作废采购合同
|
||||
*
|
||||
* @param contractIds 需要作废的采购合同主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int nullifyPurchaseContractByContractIds(Long[] contractIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<ImsIntoInventoryDetailAdd> imsintoInventoryDetailAddList=new ArrayList<>();
|
||||
ImsIntoInventoryDetailAdd imsintoInventoryDetailAdd=new ImsIntoInventoryDetailAdd();
|
||||
List<ImsIntoInventoryDetailVO> 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<ImsOutInventoryDetailAdd> 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()))) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,11 @@ public class DataScreeningServiceImpl implements DataScreeningService {
|
|||
case DISH:
|
||||
//查询所有绑定的菜谱
|
||||
List<String> 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();
|
||||
|
|
|
|||
|
|
@ -327,6 +327,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDishPlanDetailIdByDishId" resultType="java.lang.Long">
|
||||
select recipe_detail_id from cook_recipe_detail where apply_date <![CDATA[ >= ]]> #{applyDate} and detail_type = '2'
|
||||
</select>
|
||||
<select id="selectRecipeDishesByDishId" resultType="com.bonus.canteen.core.cook.domain.CookDishes">
|
||||
select distinct a.dishes_id as dishesid,b.dishes_name as dishesname from cook_recipe_dishes a left join cook_dishes b on a.dishes_id=b.dishes_id where a.dishes_id = #{dishesId}
|
||||
</select>
|
||||
<select id="selectCookDishesMaterialList"
|
||||
resultType="com.bonus.canteen.core.cook.domain.CookDishesMaterial">
|
||||
select
|
||||
|
|
|
|||
|
|
@ -54,7 +54,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ELSE 0
|
||||
END AS has_inventory
|
||||
from cook_material cm
|
||||
LEFT JOIN ims_inventory iin ON iin.material_id = cm.material_id and iin.del_flag=0
|
||||
left join (
|
||||
SELECT
|
||||
sum(material_num) as material_num,material_id
|
||||
from ims_inventory
|
||||
where del_flag=0
|
||||
group by material_id
|
||||
)iin ON iin.material_id = cm.material_id
|
||||
left join cook_material_type cmt on cm.material_type_id = cmt.material_type_id
|
||||
left join cook_nutrition_type cnt on cm.nutrition_type_id = cnt.nutrition_type_id
|
||||
left join cook_nutrition cn on cm.nutrition_id = cn.nutrition_id
|
||||
|
|
|
|||
|
|
@ -175,9 +175,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and mdsr.sale_month = month(curdate())
|
||||
left join basic_canteen ac on mr.canteen_id = ac.canteen_id
|
||||
left join basic_stall ass on mr.stall_id = ass.stall_id
|
||||
left join basic_stall_mealtime bsm on mr.stall_id=bsm.stall_id and mrd.mealtime_type=bsm.mealtime_type
|
||||
where
|
||||
mrd.apply_date = #{applyDate}
|
||||
and mr.recipe_id = #{recipeId}
|
||||
and mr.recipe_id = #{recipeId} and bsm.if_enable='1'
|
||||
order by
|
||||
md.dishes_id asc
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
<resultMap type="com.bonus.canteen.core.health.domain.HealthPersonInfo" id="HealthPersonInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="registerDate" column="register_date" />
|
||||
<result property="bloodType" column="blood_type" />
|
||||
<result property="maritalStatus" column="marital_status" />
|
||||
<result property="pregnantStatus" column="pregnant_status" />
|
||||
<result property="pregnancyDate" column="pregnancy_date" />
|
||||
<result property="doctorAdvice" column="doctor_advice" />
|
||||
<result property="ifHospitalized" column="if_hospitalized" />
|
||||
<result property="doctorNum" column="doctor_num" />
|
||||
<result property="hospitalNum" column="hospital_num" />
|
||||
<result property="inpatientDate" column="inpatient_date" />
|
||||
<result property="inpatientResult" column="inpatient_result" />
|
||||
<result property="weightControl" column="weight_control" />
|
||||
<result property="allergen" column="allergen" />
|
||||
<result property="labourIntensity" column="labour_intensity" />
|
||||
<result property="healthState" column="health_state" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="orgFullName" column="dept_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHealthPersonMedicalReportVo">
|
||||
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"
|
|||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectHealthPersonMedicalReportList2" parameterType="com.bonus.canteen.core.health.domain.HealthPersonInfo" resultMap="HealthPersonInfoResult">
|
||||
SELECT a.user_id,
|
||||
a.nick_name,
|
||||
a.phonenumber as mobile,
|
||||
a.photo_url as custPhotoUrl,
|
||||
a.sex,
|
||||
d.height,
|
||||
d.weight,
|
||||
d.bmi,
|
||||
b.doctor_advice,
|
||||
b.allergen,
|
||||
b.labour_intensity,
|
||||
b.pregnant_status,
|
||||
b.doctor_num,
|
||||
b.hospital_num,
|
||||
b.inpatient_date
|
||||
from sys_user a
|
||||
left join health_person_info b on a.user_id = b.user_id
|
||||
left join health_person_body_record d on a.user_id = d.user_id and d.if_latest = 1
|
||||
where 1=1
|
||||
<if test="articleTitle != null and articleTitle != ''">
|
||||
and(a.nick_name like concat('%', #{articleTitle}, '%') or a.phonenumber like concat('%', #{encryptedSearchValue}, '%') or b.doctor_num like concat('%', #{articleTitle}, '%'))
|
||||
</if>
|
||||
<if test="chronicIds != null and chronicIds != ''">
|
||||
and c.chronic_id in (${chronicIds})
|
||||
</if>
|
||||
<if test="doctorAdvices != null and doctorAdvices != ''">
|
||||
and b.doctor_advice in (${doctorAdvices})
|
||||
</if>
|
||||
<if test="deptIds != null and deptIds != ''">
|
||||
and a.dept_id in (${deptIds})
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectHealthPersonMedicalReportById" parameterType="Long" resultMap="HealthPersonMedicalReportResult">
|
||||
<include refid="selectHealthPersonMedicalReportVo"/>
|
||||
where id = #{id}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
'' as avatar
|
||||
from kitchen_staff_info
|
||||
where mobile = #{phoneNumber}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="addPhysicalExaminationData">
|
||||
|
|
@ -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})
|
||||
</insert>
|
||||
|
||||
<select id="selectUserById" resultType="com.bonus.canteen.core.healthmachine.bean.BodyMeasurement">
|
||||
select
|
||||
staff_id as userId,
|
||||
staff_no as userCode
|
||||
from kitchen_staff_info
|
||||
where staff_id = #{userId}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkIsExistCurrentSysUser" resultType="com.bonus.canteen.core.healthmachine.bean.UserData">
|
||||
select user_id as userId,
|
||||
user_name as nickName,
|
||||
case when sex = 0 then 'man' when sex = 1 then 'women' else '' end as sex,
|
||||
0 as age,
|
||||
'' as avatar
|
||||
from sys_user
|
||||
where phonenumber = #{phoneNumber} and del_flag = 0
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectSysUserById" resultType="com.bonus.canteen.core.healthmachine.bean.BodyMeasurement">
|
||||
select
|
||||
user_id as userId,
|
||||
user_code as userCode
|
||||
from sys_user
|
||||
where user_id = #{userId} and del_flag = 0
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -221,7 +221,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getDrpCheckInventoryPage" resultType="com.bonus.canteen.core.ims.vo.CheckInventoryPageVO">
|
||||
SELECT dci.check_id,
|
||||
select * from (
|
||||
SELECT dci.check_id,
|
||||
dci.check_code,
|
||||
dci.warehouse_id,
|
||||
dw.warehouse_name,
|
||||
|
|
@ -238,7 +239,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
dci.update_time,
|
||||
dci.deal_with_status,
|
||||
dci.total_profit_loss,
|
||||
dicd.differ_num,
|
||||
sum(replace(dicd.differ_num,'-','')) as differ_num,
|
||||
sum(replace(dicd.differ_amount,'-','')) as differamount,
|
||||
dci.process_instance_id,
|
||||
dw.area_id,
|
||||
aa.area_name,
|
||||
|
|
@ -288,6 +290,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</if>
|
||||
</where>
|
||||
order by dci.create_time desc
|
||||
group by dci.check_code
|
||||
) a
|
||||
order by create_time desc
|
||||
</select>
|
||||
<update id="setData" parameterType="java.lang.String">
|
||||
${sqld}
|
||||
</update>
|
||||
<select id="getData" parameterType="java.lang.String" resultType="com.bonus.canteen.core.ims.domain.ImsIntoInventoryDetail">
|
||||
${sqld}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -375,4 +375,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND inventory_num >= #{fetchNum}
|
||||
AND del_flag = '0'
|
||||
</update>
|
||||
|
||||
<select id="selectImsIntoInventoryDetailListByInventoryIdD" resultMap="ImsIntoInventoryDetailResult">
|
||||
select into_detail_id,
|
||||
iiid.into_id,
|
||||
iiid.into_code,
|
||||
inventory_id,
|
||||
material_id,
|
||||
iiid.supplier_id,
|
||||
unit_id,
|
||||
size,
|
||||
unit_price,
|
||||
total_price,
|
||||
delivery_num,
|
||||
pur_num,
|
||||
unqualified_num,
|
||||
inventory_num,
|
||||
product_date,
|
||||
expire_time,
|
||||
img_url,
|
||||
if_fill_inventory,
|
||||
relate_order_goods_detail_id,
|
||||
relate_delivery_goods_detail_id,
|
||||
iiid.del_flag,
|
||||
iiid.create_by,
|
||||
iiid.create_time,
|
||||
iiid.update_by,
|
||||
iiid.update_time
|
||||
from ims_into_inventory_detail iiid
|
||||
left join ims_into_inventory iii on iii.into_id = iiid.into_id
|
||||
where iiid.inventory_id = #{inventoryId}
|
||||
and iii.status = '2'
|
||||
and iiid.inventory_num > 0
|
||||
and iiid.del_flag = '0'
|
||||
order by iii.into_date
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="approveRemark" column="approve_remark" />
|
||||
<result property="totalNum" column="total_num" />
|
||||
<result property="totalIntoNum" column="total_into_num" />
|
||||
<result property="totalQualifiedNum" column="total_qualified_num" />
|
||||
<result property="approveTime" column="approve_time" />
|
||||
<result property="stallId" column="stall_id" />
|
||||
<result property="canteenId" column="canteen_id" />
|
||||
|
|
@ -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
|
||||
</sql>
|
||||
|
||||
<select id="selectOrderGoodsList" parameterType="com.bonus.canteen.core.ims.domain.OrderGoods" resultMap="OrderGoodsResult">
|
||||
<include refid="selectOrderGoodsVo"/>
|
||||
<where>
|
||||
iog.del_flag = '0'
|
||||
<if test="isInspect != null and isInspect != '' ">
|
||||
<if test="isInspect != null and isInspect != '' and isInspect != 0 and isInspect != '0'.toString()">
|
||||
and iog.if_all_inspect = #{isInspect}
|
||||
</if>
|
||||
<if test="ifAllInto != null and ifAllInto != '' ">
|
||||
and iog.if_all_into = #{ifAllInto}
|
||||
</if>
|
||||
|
||||
<if test="isInspect == 0 || isInspect == '0'.toString()">
|
||||
and iig.delivery_total_num > 0
|
||||
</if>
|
||||
<if test="supplierId != null "> and iog.supplier_id = #{supplierId}</if>
|
||||
<if test="orderStatus != null "> and iog.order_status = #{orderStatus}</if>
|
||||
<if test="orderAmount != null "> and iog.order_amount = #{orderAmount}</if>
|
||||
|
|
@ -97,12 +107,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="ifTotalIntoInventory != null ">
|
||||
and iog.total_num <![CDATA[ > ]]> iog.totalIntoNum
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
<if test="startTime != null">
|
||||
and iog.request_arrival_time <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
<if test="endTime != null">
|
||||
and iog.request_arrival_time <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
and iog.request_arrival_time <![CDATA[ >= ]]> Date_format(#{startDateTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and iog.request_arrival_time <![CDATA[ <= ]]> Date_format(#{endDateTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="orderGoodsCodeList != null and orderGoodsCodeList.size() > 0">
|
||||
and iog.order_goods_code in
|
||||
<foreach collection="orderGoodsCodeList" item="planCode" separator="," open="(" close=")">
|
||||
|
|
|
|||
|
|
@ -246,4 +246,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{contractId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="nullifyPurchaseContractByContractId" parameterType="String">
|
||||
update ims_purchase_contract set contract_status = '4' where contract_id in
|
||||
<foreach item="contractId" collection="array" open="(" separator="," close=")">
|
||||
#{contractId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -76,6 +76,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="endDateTime != null">
|
||||
and ipp.purchase_date <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and ipp.purchase_date <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and ipp.purchase_date <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="planCodeList != null and planCodeList.size() > 0">
|
||||
and ipp.plan_code in
|
||||
<foreach collection="planCodeList" item="planCode" separator="," open="(" close=")">
|
||||
|
|
|
|||
|
|
@ -409,6 +409,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- SELECT-->
|
||||
<!-- a.supplier_code,-->
|
||||
<!-- a.supplier_id,-->
|
||||
<!-- a.supplier_name,-->
|
||||
<!-- a.area_id,-->
|
||||
<!-- aa.area_name,-->
|
||||
<!-- sum(IF(iis.bid_status = '3',1,0)) as bidNumbers,-->
|
||||
<!-- sum(IF(iis.bid_status = '3',iis.quote_amount,0)) as cumulativeBidAmount,-->
|
||||
<!-- IFNULL(sum(IF(iis.bid_status = '3',1,0)) / COUNT(iis.inquiry_supplier_id) * 100,0) as deliveryPassRate,-->
|
||||
|
||||
|
||||
<!-- FROM-->
|
||||
<!-- ims_supplier a-->
|
||||
<!-- LEFT JOIN basic_area aa on a.area_id = aa.area_id-->
|
||||
<!-- left join ims_inquiry_supplier iis on iis.inquiry_supplier_id = a.supplier_id-->
|
||||
|
||||
<!-- WHERE-->
|
||||
<!-- a.del_flag = 0-->
|
||||
<!-- GROUP BY a.supplier_id-->
|
||||
</select>
|
||||
|
||||
<select id="selectSupplier" resultType="com.bonus.canteen.core.ims.vo.SupplierScoreVO">
|
||||
|
|
|
|||
Loading…
Reference in New Issue