Commit a4961482 authored by 赵啸非's avatar 赵啸非

添加材料排序

parent c277a591
......@@ -10,6 +10,7 @@ import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.service.DeviceService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -43,6 +44,7 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("sample/bill")
@Slf4j
public class SampleBillController extends BaseCRUDJsonBodyMappingController<SampleBillService, SampleBillEntity, Long> {
@Autowired
......@@ -76,7 +78,10 @@ public class SampleBillController extends BaseCRUDJsonBodyMappingController<Samp
public String save(@RequestBody SampleBillEntity entity) {
if (ObjectUtils.isEmpty(entity.getDeviceName()) && !ObjectUtils.isEmpty(entity.getDeviceCode())) {
DeviceEntity deviceEntity = deviceService.selectOne(new DeviceQuery().deviceCode(entity.getDeviceCode()));
entity.setDeviceName(deviceEntity.getDeviceName());
if(!ObjectUtils.isEmpty(deviceEntity)){
entity.setDeviceName(deviceEntity.getDeviceName());
}
}
entity.setMatterFullName(entity.getMatterName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment