问题修改
This commit is contained in:
parent
6d5b2c2c65
commit
96fe216bc1
|
|
@ -71,6 +71,17 @@ public class BackApplyController {
|
||||||
return backApplyService.addBackApplyData(request,files);
|
return backApplyService.addBackApplyData(request,files);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据修改接口
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("数据修改接口")
|
||||||
|
@PostMapping("updateBackApplyData")
|
||||||
|
public ServerResponse updateBackApplyData(HttpServletRequest request, @RequestParam(value = "file[]",required = false) MultipartFile[] files) {
|
||||||
|
return backApplyService.updateBackApplyData(request,files);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("详情数据接口-基本信息、附件文档")
|
@ApiOperation("详情数据接口-基本信息、附件文档")
|
||||||
@GetMapping("getDetails")
|
@GetMapping("getDetails")
|
||||||
@DecryptAndVerify(decryptedClass = BackApplyVo.class)
|
@DecryptAndVerify(decryptedClass = BackApplyVo.class)
|
||||||
|
|
@ -88,6 +99,13 @@ public class BackApplyController {
|
||||||
return pageInfo;
|
return pageInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("详情数据接口-基本信息、明细、附件文档")
|
||||||
|
@GetMapping("getDetailsAndFile")
|
||||||
|
@DecryptAndVerify(decryptedClass = BackApplyVo.class)
|
||||||
|
public ServerResponse getDetailsAndFile(EncryptedReq<BackApplyVo> dto) {
|
||||||
|
return backApplyService.getDetailsAndFile(dto.getData());
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("导出接口")
|
@ApiOperation("导出接口")
|
||||||
@PostMapping("export")
|
@PostMapping("export")
|
||||||
public void export(HttpServletResponse response, @RequestBody BackApplyVo dto) {
|
public void export(HttpServletResponse response, @RequestBody BackApplyVo dto) {
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,15 @@ public class PlanApplyController {
|
||||||
return service.getProSelect(dto.getData());
|
return service.getProSelect(dto.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程下拉选,带公司
|
||||||
|
*/
|
||||||
|
@PostMapping("getProSelectAndCompanyName")
|
||||||
|
@DecryptAndVerify(decryptedClass = PlanApplyVo.class)
|
||||||
|
public ServerResponse getProSelectAndCompanyName(EncryptedReq<PlanApplyVo> dto) {
|
||||||
|
return service.getProSelectAndCompanyName(dto.getData());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 需求计划申请-详情
|
* 需求计划申请-详情
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -78,5 +78,10 @@ public class PurchaseVo extends ParentVo {
|
||||||
|
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,4 +92,6 @@ public class BackApplyVo extends ParentVo {
|
||||||
* 退料清点详情list
|
* 退料清点详情list
|
||||||
*/
|
*/
|
||||||
private List<BackApplyDetailsVo> detailsList;
|
private List<BackApplyDetailsVo> detailsList;
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -151,4 +151,9 @@ public class ProVo {
|
||||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,4 +59,23 @@ public interface BackApplyMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BackApplyDetailsVo> getDetailsList(BackApplyDetailsVo data);
|
List<BackApplyDetailsVo> getDetailsList(BackApplyDetailsVo data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除退料清点明细
|
||||||
|
* @param backApplyVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteBackApplyDetailsById(BackApplyVo backApplyVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改退料清点状态
|
||||||
|
*/
|
||||||
|
int updateBackApplyStatus(BackApplyVo backApplyVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情:明细、导出
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BackApplyDetailsVo> getDetailsListTwo(BackApplyDetailsVo bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.bonus.aqgqj.business.backstage.entity.MaTypeVo;
|
||||||
import com.bonus.aqgqj.business.backstage.entity.plan.PlanApplyVo;
|
import com.bonus.aqgqj.business.backstage.entity.plan.PlanApplyVo;
|
||||||
import com.bonus.aqgqj.business.backstage.entity.plan.PlanAuditRecordVo;
|
import com.bonus.aqgqj.business.backstage.entity.plan.PlanAuditRecordVo;
|
||||||
import com.bonus.aqgqj.business.backstage.entity.plan.PlanDetailVo;
|
import com.bonus.aqgqj.business.backstage.entity.plan.PlanDetailVo;
|
||||||
|
import com.bonus.aqgqj.business.backstage.entity.pro.ProVo;
|
||||||
import org.apache.ibatis.annotations.MapKey;
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
@ -184,4 +185,11 @@ public interface PlanApplyMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
MaTypeVo getExist(@Param("param") MaTypeVo planDevBean);
|
MaTypeVo getExist(@Param("param") MaTypeVo planDevBean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工程下拉选和公司名称
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ProVo> getProSelectAndCompanyName(PlanApplyVo data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ import com.google.common.collect.Maps;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -205,6 +207,7 @@ public class PurchaseServiceImpl implements PurchaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ServerResponse addPurchaseData(HttpServletRequest request, MultipartFile[] files) {
|
public ServerResponse addPurchaseData(HttpServletRequest request, MultipartFile[] files) {
|
||||||
try {
|
try {
|
||||||
String params = request.getParameter("params");
|
String params = request.getParameter("params");
|
||||||
|
|
@ -357,6 +360,7 @@ public class PurchaseServiceImpl implements PurchaseService {
|
||||||
return ServerResponse.createSuccess("新增成功", outPlanVo);
|
return ServerResponse.createSuccess("新增成功", outPlanVo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
}
|
}
|
||||||
return ServerResponse.createErroe("新增失败");
|
return ServerResponse.createErroe("新增失败");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,16 @@ public interface BackApplyService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BackApplyDetailsVo> getDetailsList(BackApplyDetailsVo data);
|
List<BackApplyDetailsVo> getDetailsList(BackApplyDetailsVo data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情:基本信息、明细、附件文档
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ServerResponse getDetailsAndFile(BackApplyVo data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据修改
|
||||||
|
*/
|
||||||
|
ServerResponse updateBackApplyData(HttpServletRequest request, MultipartFile[] files);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -126,6 +128,40 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
return ServerResponse.createErroe("新增失败");
|
return ServerResponse.createErroe("新增失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public ServerResponse updateBackApplyData(HttpServletRequest request, MultipartFile[] files) {
|
||||||
|
try {
|
||||||
|
String param = request.getParameter("params");
|
||||||
|
if(StringHelper.isEmpty(param)){
|
||||||
|
return ServerResponse.createErroe("请上传参数!");
|
||||||
|
}
|
||||||
|
BackApplyVo backApplyVo = JSON.parseObject(param, BackApplyVo.class);
|
||||||
|
if (backApplyVo.getId()!= null){
|
||||||
|
//将以前的详情数据删除
|
||||||
|
int res = backApplyMapper.deleteBackApplyDetailsById(backApplyVo);
|
||||||
|
List<BackApplyDetailsVo> list = backApplyVo.getDetailsList();
|
||||||
|
if(list != null && list.size() > 0){
|
||||||
|
int isSuccess1 = backApplyMapper.addBackApplyDataDetails(backApplyVo,list);
|
||||||
|
if(isSuccess1 != list.size()){
|
||||||
|
return ServerResponse.createErroe("退料清点明细新增失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//修改保存状态
|
||||||
|
if(backApplyVo.getStatus()!=null){
|
||||||
|
int re = backApplyMapper.updateBackApplyStatus(backApplyVo);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ServerResponse.createErroe("请上传退料清点编号!");
|
||||||
|
}
|
||||||
|
return ServerResponse.createSuccess("修改成功","修改成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return ServerResponse.createErroe("退料清点修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情:基本信息、附件文档
|
* 详情:基本信息、附件文档
|
||||||
*/
|
*/
|
||||||
|
|
@ -156,6 +192,23 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServerResponse getDetailsAndFile(BackApplyVo data) {
|
||||||
|
try {
|
||||||
|
BackApplyVo vo = backApplyMapper.getDetails(data);
|
||||||
|
List<FileUploadVo> flieList = uploadService.getFileList(data.getId() + "", "st_back_apply", null);
|
||||||
|
BackApplyDetailsVo bean = new BackApplyDetailsVo();
|
||||||
|
bean.setId(data.getId());
|
||||||
|
List<BackApplyDetailsVo> list = backApplyMapper.getDetailsListTwo(bean);
|
||||||
|
vo.setFileList(flieList);
|
||||||
|
vo.setDetailsList(list);
|
||||||
|
return ServerResponse.createSuccess(vo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return ServerResponse.createSuccess(new BackApplyVo());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理退料编号
|
* 处理退料编号
|
||||||
* @param value
|
* @param value
|
||||||
|
|
|
||||||
|
|
@ -118,4 +118,11 @@ public interface PlanApplyService {
|
||||||
* @date 2024/12/20 15:28
|
* @date 2024/12/20 15:28
|
||||||
*/
|
*/
|
||||||
ServerResponse importExcelTools(HttpServletRequest request, MultipartFile[] files);
|
ServerResponse importExcelTools(HttpServletRequest request, MultipartFile[] files);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程下拉选,带公司
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ServerResponse getProSelectAndCompanyName(PlanApplyVo data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.bonus.aqgqj.business.backstage.entity.MaTypeVo;
|
||||||
import com.bonus.aqgqj.business.backstage.entity.plan.PlanApplyVo;
|
import com.bonus.aqgqj.business.backstage.entity.plan.PlanApplyVo;
|
||||||
import com.bonus.aqgqj.business.backstage.entity.plan.PlanAuditRecordVo;
|
import com.bonus.aqgqj.business.backstage.entity.plan.PlanAuditRecordVo;
|
||||||
import com.bonus.aqgqj.business.backstage.entity.plan.PlanDetailVo;
|
import com.bonus.aqgqj.business.backstage.entity.plan.PlanDetailVo;
|
||||||
|
import com.bonus.aqgqj.business.backstage.entity.pro.ProVo;
|
||||||
import com.bonus.aqgqj.business.backstage.mapper.plan.PlanApplyMapper;
|
import com.bonus.aqgqj.business.backstage.mapper.plan.PlanApplyMapper;
|
||||||
import com.bonus.aqgqj.manager.advice.ValidatorsUtils;
|
import com.bonus.aqgqj.manager.advice.ValidatorsUtils;
|
||||||
import com.bonus.aqgqj.manager.common.util.DateTimeHelper;
|
import com.bonus.aqgqj.manager.common.util.DateTimeHelper;
|
||||||
|
|
@ -187,20 +188,19 @@ public class PlanApplyServiceImpl implements PlanApplyService {
|
||||||
Row row = sheet.getRow(i);
|
Row row = sheet.getRow(i);
|
||||||
MaTypeVo data = new MaTypeVo();
|
MaTypeVo data = new MaTypeVo();
|
||||||
// 获取全部列的值
|
// 获取全部列的值
|
||||||
data.setType(row.getCell(1).getStringCellValue()); //物资类型
|
data.setName(row.getCell(1).getStringCellValue()); //物资名称
|
||||||
data.setName(row.getCell(2).getStringCellValue()); //物资名称
|
data.setModel(row.getCell(2).getStringCellValue()); //物资型号
|
||||||
data.setModel(row.getCell(3).getStringCellValue()); //物资型号
|
data.setUnitName(row.getCell(3).getStringCellValue()); //单位
|
||||||
data.setUnitName(row.getCell(4).getStringCellValue()); //单位
|
|
||||||
// data.setNeedNum(row.getCell(5).getStringCellValue()); //数量
|
// data.setNeedNum(row.getCell(5).getStringCellValue()); //数量
|
||||||
Cell cell5 = row.getCell(5);
|
Cell cell4 = row.getCell(4);
|
||||||
if(cell5 != null){
|
if(cell4 != null){
|
||||||
String needNum ;
|
String needNum ;
|
||||||
switch (cell5.getCellType()){
|
switch (cell4.getCellType()){
|
||||||
case STRING:
|
case STRING:
|
||||||
needNum = cell5.getStringCellValue();
|
needNum = cell4.getStringCellValue();
|
||||||
break;
|
break;
|
||||||
case NUMERIC:
|
case NUMERIC:
|
||||||
needNum = String.valueOf(cell5.getNumericCellValue());
|
needNum = String.valueOf(cell4.getNumericCellValue());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
needNum = "";
|
needNum = "";
|
||||||
|
|
@ -209,7 +209,7 @@ public class PlanApplyServiceImpl implements PlanApplyService {
|
||||||
data.setNeedNum(needNum);
|
data.setNeedNum(needNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
Cell cell = row.getCell(6); // 假设时间是在第7列(0-based index 6)
|
Cell cell = row.getCell(5); // 假设时间是在第7列(0-based index 6)
|
||||||
if (cell != null) {
|
if (cell != null) {
|
||||||
String timeValue;
|
String timeValue;
|
||||||
switch (cell.getCellType()) {
|
switch (cell.getCellType()) {
|
||||||
|
|
@ -239,7 +239,7 @@ public class PlanApplyServiceImpl implements PlanApplyService {
|
||||||
log.warn("单元格为空");
|
log.warn("单元格为空");
|
||||||
data.setTimes("");
|
data.setTimes("");
|
||||||
}
|
}
|
||||||
data.setRemarks(getCellStringValue(row.getCell(7)));//备注
|
data.setRemarks(getCellStringValue(row.getCell(6)));//备注
|
||||||
dataList.add(data);
|
dataList.add(data);
|
||||||
}
|
}
|
||||||
workbook.close();
|
workbook.close();
|
||||||
|
|
@ -247,7 +247,7 @@ public class PlanApplyServiceImpl implements PlanApplyService {
|
||||||
}
|
}
|
||||||
if(dataList!=null && !dataList.isEmpty()){
|
if(dataList!=null && !dataList.isEmpty()){
|
||||||
for (MaTypeVo planDevBean : dataList) {
|
for (MaTypeVo planDevBean : dataList) {
|
||||||
//根据物资类型,物资名称,物资型号 去数据库查询是否存在
|
//根据物资名称,物资型号 去数据库查询是否存在
|
||||||
MaTypeVo bean = mapper.getExist(planDevBean);
|
MaTypeVo bean = mapper.getExist(planDevBean);
|
||||||
if(bean == null){
|
if(bean == null){
|
||||||
// 在数据库中不存在,则记录下,全部判断完,返回到前段,提示
|
// 在数据库中不存在,则记录下,全部判断完,返回到前段,提示
|
||||||
|
|
@ -258,7 +258,7 @@ public class PlanApplyServiceImpl implements PlanApplyService {
|
||||||
}
|
}
|
||||||
// 如果存在数据库中不存在的数据,返回提示
|
// 如果存在数据库中不存在的数据,返回提示
|
||||||
if (!nonExistList.isEmpty()) {
|
if (!nonExistList.isEmpty()) {
|
||||||
return ServerResponse.createError("导入失败,以下数据在数据库中不存在", nonExistList);
|
return ServerResponse.createError("导入失败,以下数据名称或规格型号不存在", nonExistList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ServerResponse.createSuccess("导入成功", dataList);
|
return ServerResponse.createSuccess("导入成功", dataList);
|
||||||
|
|
@ -268,6 +268,17 @@ public class PlanApplyServiceImpl implements PlanApplyService {
|
||||||
return ServerResponse.createError("导入失败,请检查表格数据",dataList);
|
return ServerResponse.createError("导入失败,请检查表格数据",dataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServerResponse getProSelectAndCompanyName(PlanApplyVo data) {
|
||||||
|
try {
|
||||||
|
List<ProVo> list = mapper.getProSelectAndCompanyName(data);
|
||||||
|
return ServerResponse.createSuccess("获取成功", list);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
return ServerResponse.createSuccess("获取成功", new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private String getCellStringValue(Cell cell) {
|
private String getCellStringValue(Cell cell) {
|
||||||
if (cell == null) return "";
|
if (cell == null) return "";
|
||||||
switch (cell.getCellType()) {
|
switch (cell.getCellType()) {
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,7 @@
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY spos.sup_id,spos.contract_id,sta.id
|
GROUP BY spos.sup_id,spos.contract_id,sta.id
|
||||||
|
ORDER BY spo.out_time DESC
|
||||||
</select>
|
</select>
|
||||||
<select id="getProNum" resultType="java.lang.String">
|
<select id="getProNum" resultType="java.lang.String">
|
||||||
select count(1)
|
select count(1)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
phone,
|
phone,
|
||||||
remark,
|
remark,
|
||||||
creator,
|
creator,
|
||||||
create_time)
|
create_time,status)
|
||||||
VALUES (#{code},
|
VALUES (#{code},
|
||||||
#{projectId},
|
#{projectId},
|
||||||
#{backTime},
|
#{backTime},
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
#{phone},
|
#{phone},
|
||||||
#{remark},
|
#{remark},
|
||||||
#{creator},
|
#{creator},
|
||||||
now())
|
now(),#{status})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="addBackApplyDataDetails">
|
<insert id="addBackApplyDataDetails">
|
||||||
INSERT INTO st_back_details(apply_id,
|
INSERT INTO st_back_details(apply_id,
|
||||||
|
|
@ -35,6 +35,14 @@
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
<update id="updateBackApplyStatus">
|
||||||
|
UPDATE st_back_apply
|
||||||
|
SET status=#{status}
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
<delete id="deleteBackApplyDetailsById">
|
||||||
|
DELETE FROM st_back_details WHERE apply_id=#{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="getBackApplyList" resultType="com.bonus.aqgqj.business.backstage.entity.back.BackApplyVo">
|
<select id="getBackApplyList" resultType="com.bonus.aqgqj.business.backstage.entity.back.BackApplyVo">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -43,7 +51,8 @@
|
||||||
su.user_name AS recipient,
|
su.user_name AS recipient,
|
||||||
sba.manager, sba.phone,
|
sba.manager, sba.phone,
|
||||||
sba.back_time as backTime,
|
sba.back_time as backTime,
|
||||||
sba.remark
|
sba.remark,
|
||||||
|
sba.`status`
|
||||||
FROM
|
FROM
|
||||||
st_back_apply sba
|
st_back_apply sba
|
||||||
LEFT JOIN bm_project bp ON sba.project_id = bp.bid_id
|
LEFT JOIN bm_project bp ON sba.project_id = bp.bid_id
|
||||||
|
|
@ -71,7 +80,7 @@
|
||||||
sba.back_time,
|
sba.back_time,
|
||||||
sba.remark
|
sba.remark
|
||||||
order by
|
order by
|
||||||
sba.back_time desc
|
sba.`status` asc ,sba.back_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="getMaxNum" resultType="java.lang.String">
|
<select id="getMaxNum" resultType="java.lang.String">
|
||||||
SELECT code
|
SELECT code
|
||||||
|
|
@ -115,6 +124,43 @@
|
||||||
mt.update_time updateTime,
|
mt.update_time updateTime,
|
||||||
mt.is_active isActive ,
|
mt.is_active isActive ,
|
||||||
sbd.num,
|
sbd.num,
|
||||||
|
sbd.model_id as modelId,
|
||||||
|
sbd.remark
|
||||||
|
FROM
|
||||||
|
st_back_apply sta
|
||||||
|
LEFT JOIN st_back_details sbd ON sbd.apply_id = sta.id
|
||||||
|
LEFT JOIN st_ma_type mt ON mt.id = sbd.model_id
|
||||||
|
LEFT JOIN st_ma_type mt2 ON mt.parent_id = mt2.id
|
||||||
|
LEFT JOIN st_ma_type mt3 ON mt2.parent_id = mt3.id
|
||||||
|
WHERE sta.id = #{id}
|
||||||
|
<if test="modelType!=null and modelType!=''">
|
||||||
|
and mt3.name like concat('%',#{modelType},'%')
|
||||||
|
</if>
|
||||||
|
<if test="modelName!=null and modelName!=''">
|
||||||
|
and mt2.name like concat('%',#{modelName},'%')
|
||||||
|
</if>
|
||||||
|
<if test="modelModel!=null and modelModel!=''">
|
||||||
|
and mt.name like concat('%',#{modelModel},'%')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="getDetailsListTwo"
|
||||||
|
resultType="com.bonus.aqgqj.business.backstage.entity.back.BackApplyDetailsVo">
|
||||||
|
SELECT
|
||||||
|
sbd.model_id as id,
|
||||||
|
mt3.NAME type,
|
||||||
|
mt2.NAME,
|
||||||
|
mt.NAME model,
|
||||||
|
mt.storage_num storageNum,
|
||||||
|
mt.unit_name unitName,
|
||||||
|
mt.LEVEL,
|
||||||
|
mt.check_cycle cycle,
|
||||||
|
mt.creator,
|
||||||
|
mt.create_time createTime,
|
||||||
|
mt.updater,
|
||||||
|
mt.update_time updateTime,
|
||||||
|
mt.is_active isActive ,
|
||||||
|
sbd.num,
|
||||||
|
sbd.model_id as modelId,
|
||||||
sbd.remark
|
sbd.remark
|
||||||
FROM
|
FROM
|
||||||
st_back_apply sta
|
st_back_apply sta
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@
|
||||||
from st_back_apply sba
|
from st_back_apply sba
|
||||||
left join st_back_details sbd on sba.id=sbd.apply_id
|
left join st_back_details sbd on sba.id=sbd.apply_id
|
||||||
left join st_ma_type_info smti on smti.model_id=sbd.model_id
|
left join st_ma_type_info smti on smti.model_id=sbd.model_id
|
||||||
|
WHERE
|
||||||
|
sba.`status`='1'
|
||||||
GROUP BY sbd.model_id
|
GROUP BY sbd.model_id
|
||||||
)sbd
|
)sbd
|
||||||
left join (
|
left join (
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
select mt.id id,mt3.name type,mt2.name , mt.name model,
|
select mt.id id,mt3.name type,mt2.name , mt.name model,
|
||||||
mt.storage_num storageNum,mt.unit_name unitName,
|
mt.storage_num storageNum,mt.unit_name unitName,
|
||||||
mt.level,
|
mt.level,
|
||||||
|
mt.id as modelId,
|
||||||
mt.check_cycle cycle,mt.creator, mt.create_time createTime,
|
mt.check_cycle cycle,mt.creator, mt.create_time createTime,
|
||||||
mt.updater, mt.update_time updateTime,mt.is_active isActive
|
mt.updater, mt.update_time updateTime,mt.is_active isActive
|
||||||
from st_ma_type mt
|
from st_ma_type mt
|
||||||
|
|
|
||||||
|
|
@ -301,8 +301,18 @@
|
||||||
CURRENT_DATE BETWEEN sc.start_time AND sc.end_time) a
|
CURRENT_DATE BETWEEN sc.start_time AND sc.end_time) a
|
||||||
ON a.modelId = mt.id
|
ON a.modelId = mt.id
|
||||||
WHERE mt.level = '3'
|
WHERE mt.level = '3'
|
||||||
and mt3.name = #{param.type}
|
|
||||||
and mt2.name = #{param.name}
|
and mt2.name = #{param.name}
|
||||||
and mt.name = #{param.model}
|
and mt.name = #{param.model}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getProSelectAndCompanyName" resultType="com.bonus.aqgqj.business.backstage.entity.pro.ProVo">
|
||||||
|
SELECT
|
||||||
|
bp.bid_id AS id,
|
||||||
|
bp.NAME AS `name` ,
|
||||||
|
bc.`NAME` as companyName
|
||||||
|
FROM
|
||||||
|
bm_project bp
|
||||||
|
LEFT JOIN bm_company bc on bc.ID=bp.COMPANY_ID
|
||||||
|
WHERE
|
||||||
|
bp.is_active = '1'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -82,7 +82,7 @@
|
||||||
|
|
||||||
|
|
||||||
<select id="getProPurchaseList" resultType="com.bonus.aqgqj.business.backstage.entity.PurchaseVo">
|
<select id="getProPurchaseList" resultType="com.bonus.aqgqj.business.backstage.entity.PurchaseVo">
|
||||||
select count(1) planNum,pro.name proName,SUM(spa.need_num) needNum , SUM(ck_num) ckNum,sum(lk_num) lkNum ,
|
select count(1) planNum,pro.name proName,bc.`NAME` as companyName,SUM(spa.need_num) needNum , SUM(ck_num) ckNum,sum(lk_num) lkNum ,
|
||||||
spa.project_id proId,
|
spa.project_id proId,
|
||||||
if(SUM(ck_num)+sum(lk_num)=0,'未发货',
|
if(SUM(ck_num)+sum(lk_num)=0,'未发货',
|
||||||
if(SUM(spa.need_num)-SUM(ck_num)-sum(lk_num)>0,'部分发货','全部发货'))
|
if(SUM(spa.need_num)-SUM(ck_num)-sum(lk_num)>0,'部分发货','全部发货'))
|
||||||
|
|
@ -90,6 +90,7 @@
|
||||||
ROUND((SUM(ck_num)+sum(lk_num))*100/ SUM(spa.need_num),2) progress
|
ROUND((SUM(ck_num)+sum(lk_num))*100/ SUM(spa.need_num),2) progress
|
||||||
from st_plan_apply spa
|
from st_plan_apply spa
|
||||||
left join bm_project pro on pro.bid_id=spa.project_id
|
left join bm_project pro on pro.bid_id=spa.project_id
|
||||||
|
LEFT JOIN bm_company bc on bc.ID=pro.COMPANY_ID
|
||||||
where spa.status_type=1
|
where spa.status_type=1
|
||||||
<if test="proId!=null and proId!=''">
|
<if test="proId!=null and proId!=''">
|
||||||
and spa.project_id=#{proId}
|
and spa.project_id=#{proId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue